|
@@ -2,12 +2,6 @@ package com.game.business.websocket.client;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.game.business.config.GameOneConfig;
|
|
|
-import com.game.business.domain.GameLottery;
|
|
|
-import com.game.business.domain.GameRecord;
|
|
|
-import com.game.business.domain.GameType;
|
|
|
-import com.game.business.service.GameLotteryService;
|
|
|
-import com.game.business.service.GameRecordService;
|
|
|
-import com.game.business.service.GameTypeService;
|
|
|
import com.game.business.util.Common;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -19,15 +13,6 @@ import javax.websocket.*;
|
|
|
@ClientEndpoint
|
|
|
public class GameOneClient {
|
|
|
|
|
|
- @Autowired
|
|
|
- private GameTypeService gameTypeService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private GameRecordService gameRecordService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private GameLotteryService gameLotteryService;
|
|
|
-
|
|
|
@OnOpen
|
|
|
public void onOpen(Session session) throws Exception{
|
|
|
System.out.printf("game one 游戏已连接 server");
|
|
@@ -75,33 +60,33 @@ public class GameOneClient {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- GameType gameType = new GameType();
|
|
|
- gameType.setGameTypeCode(code);
|
|
|
- GameType dbGameType = gameTypeService.selectGameType(gameType);
|
|
|
- if(dbGameType == null){
|
|
|
- System.out.printf("game one 游戏类型数据库不匹配");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- GameRecord record = JSONObject.parseObject(message, GameRecord.class);
|
|
|
- record.setGameTypeId(dbGameType.getGameTypeId());
|
|
|
- gameRecordService.insertGameRecord(record);
|
|
|
-
|
|
|
- GameLottery gameLottery = new GameLottery();
|
|
|
- gameLottery.setGameTypeId(dbGameType.getGameTypeId());
|
|
|
- gameLottery.setGameDate(record.getGameDate());
|
|
|
-
|
|
|
- GameLottery dbGameLottery = gameLotteryService.selectGameLottery(gameLottery);
|
|
|
-
|
|
|
- if(dbGameLottery == null){
|
|
|
- gameLotteryService.insertGameLottery(gameLottery);
|
|
|
- }else{
|
|
|
- if(record.getIsLottery() == 1) {
|
|
|
- dbGameLottery.setGameLotteryDate(record.getGameRecordDate());
|
|
|
- dbGameLottery.setGameLotterySucc(record.getGameLotterySucc());
|
|
|
- gameLotteryService.updateGameLottery(dbGameLottery);
|
|
|
- }
|
|
|
- }
|
|
|
+// GameType gameType = new GameType();
|
|
|
+// gameType.setGameTypeCode(code);
|
|
|
+// GameType dbGameType = gameTypeService.selectGameType(gameType);
|
|
|
+// if(dbGameType == null){
|
|
|
+// System.out.printf("game one 游戏类型数据库不匹配");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+//
|
|
|
+// GameRecord record = JSONObject.parseObject(message, GameRecord.class);
|
|
|
+// record.setGameTypeId(dbGameType.getGameTypeId());
|
|
|
+// gameRecordService.insertGameRecord(record);
|
|
|
+//
|
|
|
+// GameLottery gameLottery = new GameLottery();
|
|
|
+// gameLottery.setGameTypeId(dbGameType.getGameTypeId());
|
|
|
+// gameLottery.setGameDate(record.getGameDate());
|
|
|
+//
|
|
|
+// GameLottery dbGameLottery = gameLotteryService.selectGameLottery(gameLottery);
|
|
|
+//
|
|
|
+// if(dbGameLottery == null){
|
|
|
+// gameLotteryService.insertGameLottery(gameLottery);
|
|
|
+// }else{
|
|
|
+// if(record.getIsLottery() == 1) {
|
|
|
+// dbGameLottery.setGameLotteryDate(record.getGameRecordDate());
|
|
|
+// dbGameLottery.setGameLotterySucc(record.getGameLotterySucc());
|
|
|
+// gameLotteryService.updateGameLottery(dbGameLottery);
|
|
|
+// }
|
|
|
+// }
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
System.out.printf("game one 接收数据异常[" + e.getMessage() + "]");
|