热游返回参数修改
This commit is contained in:
parent
6c2ff98b5e
commit
fc5ff8078d
@ -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<HotGameCoin> updateUserCoin(@RequestBody HotGameUpdateRequest update) {
|
||||
public HotGameResponse<HotGameCoinVO> 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<HotGameCoin>()
|
||||
.setData(new HotGameCoin()
|
||||
.setBalanceCoin(0L)
|
||||
return new HotGameResponse<HotGameCoinVO>()
|
||||
.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<HotGameCoin>()
|
||||
.setData(new HotGameCoin()
|
||||
.setBalanceCoin(0L)
|
||||
return new HotGameResponse<HotGameCoinVO>()
|
||||
.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<HotGameCoinVO> res = new HotGameResponse<>();
|
||||
res.setData(new HotGameCoinVO().setCoin(data.getBalanceCoin()).setResponseId(IdWorkerUtils.getIdStr()));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user