From 7cd3dea07f5b7cefad9dea9fd7daf992449aaac8 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 12 三月 2024 18:24:38 +0800 Subject: [PATCH] 修改bug --- cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java index 482a6be..73b6c4e 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java +++ b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java @@ -18,10 +18,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; @@ -92,25 +89,18 @@ }) public ResultUtil<List<TGameConfig>> queryGameList(Integer siteId, Integer storeId) { try { - Integer uid = tokenUtil.getUserIdFormRedis(); AppUser appUser = appUserClient.queryAppUser(uid); List<TGameConfig> tGameConfigs = new ArrayList<>(); - if (appUser.getAddUserId() == null) { - - List<SiteLock> lock = lockService.list(new QueryWrapper<SiteLock>().eq("siteId", siteId)); - Date now = new Date(); for (SiteLock siteLock : lock) { if (now.after(siteLock.getStartTime()) && now.before(siteLock.getEndTime())) { return ResultUtil.error("当前场地已被锁定"); } } - } - List<TGame> list = gameService.list(new LambdaQueryWrapper<TGame>().eq(TGame::getSiteId, siteId).eq(TGame::getStoreId, storeId).eq(TGame::getState, 0)); if (list.size() > 0) { Integer id = list.get(0).getId(); @@ -411,4 +401,15 @@ } + /** + * 根据sutuid获取游戏数据 + * @param sutuId + * @return + */ + @ResponseBody + @PostMapping("/getTGameBySutuId") + public TGame getTGameBySutuId(@RequestBody String sutuId){ + return gameService.getOne(new QueryWrapper<TGame>().eq("blue", sutuId).or() + .eq("red", sutuId).eq("state", 0)); + } } -- Gitblit v1.7.1