分销:绑定分销的 url 调整

This commit is contained in:
YunaiV 2023-09-09 21:05:44 +08:00
parent cd51d57f12
commit a47d744f64
4 changed files with 11 additions and 10 deletions

View File

@ -27,7 +27,7 @@ public class BrokerageApiImpl implements BrokerageApi {
@Override
public boolean bindUser(Long userId, Long bindUserId, Boolean isNewUser) {
return brokerageUserService.bindUser(userId, bindUserId, isNewUser);
return brokerageUserService.bindBrokerageUser(userId, bindUserId, isNewUser);
}
}

View File

@ -43,6 +43,13 @@ public class AppBrokerageUserController {
return success(respVO);
}
@PutMapping("/bind")
@Operation(summary = "绑定推广员")
@PreAuthenticated
public CommonResult<Boolean> bindBrokerageUser(@Valid @RequestBody AppBrokerageUserBindReqVO reqVO) {
return success(brokerageUserService.bindBrokerageUser(getLoginUserId(), reqVO.getBindUserId(), false));
}
// TODO 芋艿临时 mock =>
@GetMapping("/get-summary")
@Operation(summary = "获得个人分销统计")
@ -119,15 +126,9 @@ public class AppBrokerageUserController {
@GetMapping("/get-rank-by-price")
@Operation(summary = "获得分销用户排行(基于佣金)")
@Parameter(name = "times", description = "时间段", required = true)
public CommonResult<Integer> getBrokerageUserRankByPrice(
public CommonResult<Integer> bindBrokerageUser(
@RequestParam("times") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) LocalDateTime[] times) {
return success(1);
}
@PutMapping("/bind-user")
@Operation(summary = "绑定推广员")
public CommonResult<Boolean> getBrokerageUserRankByPrice(@Valid AppBrokerageUserBindReqVO reqVO) {
return success(brokerageUserService.bindUser(getLoginUserId(), reqVO.getBindUserId(), false));
}
}

View File

@ -103,6 +103,6 @@ public interface BrokerageUserService {
* @param isNewUser 是否为新用户
* @return 是否绑定
*/
boolean bindUser(Long userId, Long bindUserId, Boolean isNewUser);
boolean bindBrokerageUser(Long userId, Long bindUserId, Boolean isNewUser);
}

View File

@ -135,7 +135,7 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
// TODO @疯狂因为现在 user 会存在使用验证码直接注册所以 isNewUser 不太好传递我们是不是可以约定绑定的时间createTime 30 秒内就认为新用户
@Override
public boolean bindUser(Long userId, Long bindUserId, Boolean isNewUser) {
public boolean bindBrokerageUser(Long userId, Long bindUserId, Boolean isNewUser) {
// TODO @疯狂userId 为空搞到参数校验里哇
if (userId == null) {
throw exception(0);