transfer 不能转账给自己
This commit is contained in:
parent
ef0be488c3
commit
d40c1055a1
@ -81,6 +81,11 @@ public enum WalletErrorCode implements IResponseErrorCode {
|
||||
* 目标用户不是充值代理
|
||||
*/
|
||||
TARGET_USER_NOT_RECHARGE_AGENCY(5013, "The target user is not a recharge agency."),
|
||||
|
||||
/**
|
||||
* 不能转账给自己
|
||||
*/
|
||||
NOT_TRANSFER_YOURSELF(5014, "You can't transfer money to yourself."),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@ -74,6 +74,7 @@ public class LotteryTransferExe {
|
||||
// 6. 判断接收用户是否是货运代理
|
||||
boolean isFreight = freightBalanceClient.existsBalance(cmd.getAcceptUserId()).getBody();
|
||||
ResponseAssert.isTrue(WalletErrorCode.TARGET_USER_NOT_RECHARGE_AGENCY, isFreight);
|
||||
ResponseAssert.isTrue(WalletErrorCode.NOT_TRANSFER_YOURSELF, !Objects.equals(cmd.getAcceptUserId(), cmd.requiredReqUserId()));
|
||||
|
||||
// 1. 获取可提现金额
|
||||
LotteryWithdrawAmountCO withdrawAmount = lotteryWithdrawAmountQryExe.execute(userId, cmd.getActivityId());;
|
||||
|
||||
@ -77,6 +77,7 @@ public class UserBankTransferGoldCmdExe {
|
||||
|
||||
boolean freight = freightBalanceService.existsBalance(cmd.getAcceptUserId());
|
||||
ResponseAssert.isTrue(WalletErrorCode.TARGET_USER_NOT_RECHARGE_AGENCY, freight);
|
||||
ResponseAssert.isTrue(WalletErrorCode.NOT_TRANSFER_YOURSELF, !Objects.equals(cmd.getAcceptUserId(), cmd.requiredReqUserId()));
|
||||
|
||||
// 上锁
|
||||
String key = "UBWTransferGold:" + cmd.requiredReqUserId();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user