code review:积分、优惠劵、佣金等逻辑

This commit is contained in:
YunaiV
2023-10-01 23:31:07 +08:00
parent 057952bdeb
commit d4417d2474
27 changed files with 47 additions and 74 deletions

View File

@ -29,11 +29,12 @@ public class PayWalletController {
@Resource
private PayWalletService payWalletService;
@GetMapping("/user-wallet")
@GetMapping("/get")
@PreAuthorize("@ss.hasPermission('pay:wallet:query')")
@Operation(summary = "获得用户钱包明细")
public CommonResult<PayWalletRespVO> getByUser(PayWalletUserReqVO reqVO) {
PayWalletDO wallet = payWalletService.getWalletByUserIdAndType(reqVO.getUserId(), reqVO.getUserType());
public CommonResult<PayWalletRespVO> getWallet(PayWalletUserReqVO reqVO) {
PayWalletDO wallet = payWalletService.getOrCreateWallet(reqVO.getUserId(), reqVO.getUserType());
return success(PayWalletConvert.INSTANCE.convert02(wallet));
}
}

View File

@ -19,4 +19,5 @@ public class PayWalletUserReqVO {
@NotNull(message = "用户类型不能为空")
@InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}")
private Integer userType;
}

View File

@ -87,12 +87,4 @@ public interface PayWalletService {
*/
void unFreezePrice(Long id, Integer price);
/**
* 获得用户的钱包明细
*
* @param userId 用户编号
* @param userType 用户类型
* @return 用户的钱包明细
*/
PayWalletDO getWalletByUserIdAndType(Long userId, Integer userType);
}

View File

@ -195,9 +195,4 @@ public class PayWalletServiceImpl implements PayWalletService {
}
}
@Override
public PayWalletDO getWalletByUserIdAndType(Long userId, Integer userType) {
return walletMapper.selectByUserIdAndType(userId, userType);
}
}