钱包 - 创建钱包充值校验修改

This commit is contained in:
jason
2023-10-23 21:47:36 +08:00
parent 9697aee898
commit 9095394fed
3 changed files with 4 additions and 10 deletions

View File

@ -19,7 +19,7 @@ public class AppPayWalletRechargeCreateReqVO {
private Long packageId;
@AssertTrue(message = "充值金额和充钱套餐不能同时为空")
public boolean validatePayPriceAndPackageId() {
public boolean isValidPayPriceAndPackageId() {
return Objects.nonNull(payPrice) || Objects.nonNull(packageId);
}
}

View File

@ -64,11 +64,6 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
@Transactional(rollbackFor = Exception.class)
public PayWalletRechargeDO createWalletRecharge(Long userId, Integer userType, String userIp,
AppPayWalletRechargeCreateReqVO reqVO) {
if (Objects.isNull(reqVO.getPayPrice()) && Objects.isNull(reqVO.getPackageId())) {
// TODO @jason @AssertTrue 貌似没有效果。需要查下原因
throw exception(WALLET_RECHARGE_PACKAGE_AND_PRICE_IS_EMPTY);
}
// 1.1 计算充值金额
int payPrice;
int bonusPrice = 0;