金额为0继续处理
This commit is contained in:
parent
fb54999074
commit
6d4d3308b8
@ -152,15 +152,24 @@ public class YomiGameServiceImpl implements YomiGameService {
|
||||
return new YomiBalanceCO(balanceResp.getBody().getDollarAmount().longValue());
|
||||
}
|
||||
|
||||
WalletReceiptResDTO res = walletGoldClient.changeBalance(
|
||||
gameEventService.buildReceipt(cmd.getPlatToken(), userId, cmd.getReasonType(),
|
||||
GoldOrigin.YOMI_GAME, gameIdStr,
|
||||
String.valueOf(cmd.getGameRoundId()), cmd.getGold())
|
||||
).getBody();
|
||||
if (res == null || res.getBalance() == null) {
|
||||
throw new Exception("wallet changeBalance failed, response is null");
|
||||
long currentBalance;
|
||||
if (cmd.getGold() == 0) {
|
||||
ResultResponse<PennyAmount> balanceResp = walletGoldClient.getBalance(userId);
|
||||
if (balanceResp == null || balanceResp.getBody() == null) {
|
||||
throw new Exception("wallet getBalance failed, response is null");
|
||||
}
|
||||
currentBalance = balanceResp.getBody().getDollarAmount().longValue();
|
||||
} else {
|
||||
WalletReceiptResDTO res = walletGoldClient.changeBalance(
|
||||
gameEventService.buildReceipt(cmd.getPlatToken(), userId, cmd.getReasonType(),
|
||||
GoldOrigin.YOMI_GAME, gameIdStr,
|
||||
String.valueOf(cmd.getGameRoundId()), cmd.getGold())
|
||||
).getBody();
|
||||
if (res == null || res.getBalance() == null) {
|
||||
throw new Exception("wallet changeBalance failed, response is null");
|
||||
}
|
||||
currentBalance = res.getBalance().getDollarAmount().longValue();
|
||||
}
|
||||
long currentBalance = res.getBalance().getDollarAmount().longValue();
|
||||
|
||||
gameEventService.markProcessed(idempotentKey, IDEMPOTENT_EXPIRE_SECONDS);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user