diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/HotGameRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/HotGameRestController.java index d563f49b..15cc687f 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/HotGameRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/HotGameRestController.java @@ -7,6 +7,7 @@ import com.red.circle.component.game.hotgame.response.HotGameCoin; import com.red.circle.component.game.hotgame.response.HotGameErrorEnum; import com.red.circle.component.game.hotgame.response.HotGameResponse; import com.red.circle.framework.web.annotation.IgnoreResultResponse; +import com.red.circle.other.app.dto.clientobject.game.HotGameCoinVO; import com.red.circle.other.app.dto.clientobject.game.HotGameUpdateRequest; import com.red.circle.other.app.service.game.override.domain.HotGameUserProfile; import com.red.circle.other.app.service.game.override.service.HotGameService; @@ -63,13 +64,13 @@ public class HotGameRestController { @IgnoreResultResponse @PostMapping("/updateBalance") - public HotGameResponse updateUserCoin(@RequestBody HotGameUpdateRequest update) { + public HotGameResponse updateUserCoin(@RequestBody HotGameUpdateRequest update) { if (Objects.isNull(update) || StringUtils.isBlanks(update.getUid(), update.getGameId(), update.getOrderId(), update.getSign()) || Objects.isNull(update.getType()) || Objects.isNull(update.getCoin())) { - return new HotGameResponse() - .setData(new HotGameCoin() - .setBalanceCoin(0L) + return new HotGameResponse() + .setData(new HotGameCoinVO() + .setCoin(0L) .setResponseId(IdWorkerUtils.getIdStr()) ).setErrorCode(HotGameErrorEnum.PARAM_ERROR.getErrorCode()); } @@ -88,16 +89,20 @@ public class HotGameRestController { .filter(Objects::nonNull).map(String::valueOf).collect(Collectors.joining(""))).toUpperCase(); if (!sign.equals(update.getSign())) { - return new HotGameResponse() - .setData(new HotGameCoin() - .setBalanceCoin(0L) + return new HotGameResponse() + .setData(new HotGameCoinVO() + .setCoin(0L) .setResponseId(IdWorkerUtils.getIdStr())) .setErrorCode(HotGameErrorEnum.SIGN_VERIFY_FAIL.getErrorCode()); } HotGameUserCoinUpdate coinUpdate = new HotGameUserCoinUpdate(); BeanUtils.copyProperties(update, coinUpdate); - return hostGameService.updateUserCoin(coinUpdate); + HotGameCoin data = hostGameService.updateUserCoin(coinUpdate).getData(); + + HotGameResponse res = new HotGameResponse<>(); + res.setData(new HotGameCoinVO().setCoin(data.getBalanceCoin()).setResponseId(IdWorkerUtils.getIdStr())); + return res; } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/HotGameCoinVO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/HotGameCoinVO.java new file mode 100644 index 00000000..1cf38d4d --- /dev/null +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/HotGameCoinVO.java @@ -0,0 +1,14 @@ +package com.red.circle.other.app.dto.clientobject.game; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain=true) +public class HotGameCoinVO { + + private Long coin; + + private String responseId; + +}