JOY-捕鱼游戏考虑bet=pay的情况
This commit is contained in:
@@ -43,7 +43,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.hutool.core.text.StrPool.DELIM_END;
|
||||
import static cn.hutool.core.text.StrPool.DELIM_START;
|
||||
import static com.accompany.common.redis.RedisKey.banner;
|
||||
import static com.accompany.common.redis.RedisKey.joy_token;
|
||||
|
||||
@Slf4j
|
||||
@@ -93,10 +92,6 @@ public class JoyGameService {
|
||||
String decryptByPrivateKey = this.decryptByPrivateKey(dataVo.getData(), joyGameConfig.getPrivateKey());
|
||||
|
||||
JoySubmitBodyVo joySubmitBodyVo = JSONObject.parseObject(decryptByPrivateKey, JoySubmitBodyVo.class);
|
||||
if (joySubmitBodyVo.getCoins() <= 0) {
|
||||
log.info("JoyGameService.submitFlow,coin less than 0,token:{},data:{}", token, data);
|
||||
return JoyResponseVo.fail(BusiStatus.SERVERERROR.getCode(), BusiStatus.SERVERERROR.getName());
|
||||
}
|
||||
|
||||
String orderId = joySubmitBodyVo.getTransactionId();
|
||||
String cacheKeyForLastPreHours = DateTimeUtil.getCacheKeyForLastPreHours(1);
|
||||
@@ -133,16 +128,26 @@ public class JoyGameService {
|
||||
log.info("JoyGameService.submitFlow,not, add-reduct,token:{},data:{}", token, data);
|
||||
return JoyResponseVo.fail(500, "type error");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(remark) && remark.startsWith(DELIM_START) && remark.endsWith(DELIM_END)) {
|
||||
boolean fishGame = StringUtils.isNotEmpty(remark) && remark.startsWith(DELIM_START) && remark.endsWith(DELIM_END);
|
||||
if (fishGame) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(remark);
|
||||
if (jsonObject.containsKey("bet") && jsonObject.containsKey("pay")) {
|
||||
fishGame = jsonObject != null && jsonObject.containsKey("bet") && jsonObject.containsKey("pay");
|
||||
if (fishGame) {
|
||||
joyGameRecord.setPay(jsonObject.getInteger("pay"));
|
||||
joyGameRecord.setBet(jsonObject.getInteger("bet"));
|
||||
}
|
||||
}
|
||||
|
||||
joyGameRecordService.save(joyGameRecord);
|
||||
|
||||
if (fishGame && joySubmitBodyVo.getCoins() == 0) {
|
||||
UserPurse userPurse = userPurseService.queryUserPurse(joyGameRecord.getUid());
|
||||
JoySubmitResult result = JoySubmitResult.builder().availableCoin(userPurse.getDiamonds().longValue()).build();
|
||||
return JoyResponseVo.success(result);
|
||||
} else if (joySubmitBodyVo.getCoins() <= 0) {
|
||||
log.info("JoyGameService.submitFlow,coin less than 0,token:{},data:{}", token, data);
|
||||
return JoyResponseVo.fail(BusiStatus.SERVERERROR.getCode(), BusiStatus.SERVERERROR.getName());
|
||||
}
|
||||
|
||||
UserPurse afterPurse = null;
|
||||
GameMsgMessage gameMsgMessage = new GameMsgMessage();
|
||||
switch (joySubmitBodyVo.getType()) {
|
||||
@@ -160,7 +165,7 @@ public class JoyGameService {
|
||||
}
|
||||
|
||||
gameMsgMessage.setRoomUid(joyGameRecord.getRoomUid());
|
||||
gameMsgMessage.setCoin(goldNum);
|
||||
gameMsgMessage.setCoin(joyGameRecord.getPay().doubleValue());
|
||||
gameMsgMessage.setGameId(joyUserInfoModel.getGameId().toString());
|
||||
gameMsgMessage.setType(joyGameRecord.getType());
|
||||
gameMsgMessage.setUid(uid);
|
||||
|
Reference in New Issue
Block a user