热游返回参数修改
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.HotGameErrorEnum;
|
||||||
import com.red.circle.component.game.hotgame.response.HotGameResponse;
|
import com.red.circle.component.game.hotgame.response.HotGameResponse;
|
||||||
import com.red.circle.framework.web.annotation.IgnoreResultResponse;
|
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.dto.clientobject.game.HotGameUpdateRequest;
|
||||||
import com.red.circle.other.app.service.game.override.domain.HotGameUserProfile;
|
import com.red.circle.other.app.service.game.override.domain.HotGameUserProfile;
|
||||||
import com.red.circle.other.app.service.game.override.service.HotGameService;
|
import com.red.circle.other.app.service.game.override.service.HotGameService;
|
||||||
@ -63,13 +64,13 @@ public class HotGameRestController {
|
|||||||
|
|
||||||
@IgnoreResultResponse
|
@IgnoreResultResponse
|
||||||
@PostMapping("/updateBalance")
|
@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(),
|
if (Objects.isNull(update) || StringUtils.isBlanks(update.getUid(), update.getGameId(),
|
||||||
update.getOrderId(), update.getSign())
|
update.getOrderId(), update.getSign())
|
||||||
|| Objects.isNull(update.getType()) || Objects.isNull(update.getCoin())) {
|
|| Objects.isNull(update.getType()) || Objects.isNull(update.getCoin())) {
|
||||||
return new HotGameResponse<HotGameCoin>()
|
return new HotGameResponse<HotGameCoinVO>()
|
||||||
.setData(new HotGameCoin()
|
.setData(new HotGameCoinVO()
|
||||||
.setBalanceCoin(0L)
|
.setCoin(0L)
|
||||||
.setResponseId(IdWorkerUtils.getIdStr())
|
.setResponseId(IdWorkerUtils.getIdStr())
|
||||||
).setErrorCode(HotGameErrorEnum.PARAM_ERROR.getErrorCode());
|
).setErrorCode(HotGameErrorEnum.PARAM_ERROR.getErrorCode());
|
||||||
}
|
}
|
||||||
@ -88,16 +89,20 @@ public class HotGameRestController {
|
|||||||
.filter(Objects::nonNull).map(String::valueOf).collect(Collectors.joining(""))).toUpperCase();
|
.filter(Objects::nonNull).map(String::valueOf).collect(Collectors.joining(""))).toUpperCase();
|
||||||
|
|
||||||
if (!sign.equals(update.getSign())) {
|
if (!sign.equals(update.getSign())) {
|
||||||
return new HotGameResponse<HotGameCoin>()
|
return new HotGameResponse<HotGameCoinVO>()
|
||||||
.setData(new HotGameCoin()
|
.setData(new HotGameCoinVO()
|
||||||
.setBalanceCoin(0L)
|
.setCoin(0L)
|
||||||
.setResponseId(IdWorkerUtils.getIdStr()))
|
.setResponseId(IdWorkerUtils.getIdStr()))
|
||||||
.setErrorCode(HotGameErrorEnum.SIGN_VERIFY_FAIL.getErrorCode());
|
.setErrorCode(HotGameErrorEnum.SIGN_VERIFY_FAIL.getErrorCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
HotGameUserCoinUpdate coinUpdate = new HotGameUserCoinUpdate();
|
HotGameUserCoinUpdate coinUpdate = new HotGameUserCoinUpdate();
|
||||||
BeanUtils.copyProperties(update, coinUpdate);
|
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