Browse Source

查询赛事成绩

zhangxin 5 days ago
parent
commit
1eb63b78b7

+ 7 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/game/GameController.java

@@ -10,6 +10,7 @@ import org.jeecg.modules.app.vo.game.FindByGameIdPriceVo;
 import org.jeecg.modules.app.vo.game.FindByIdResponse;
 import org.jeecg.modules.app.vo.game.FindPagResponse;
 import org.jeecg.modules.app.vo.game.FindPageGameVO;
+import org.jeecg.modules.system.app.entity.AppGame;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -50,4 +51,10 @@ public class GameController {
     public Result<FindByGameIdPriceVo> findByGameId(@RequestParam("id") String id){
         return iGameService.findByGameId(id);
     }
+
+    @GetMapping("/findScoreByGameId")
+    @Operation(summary = "根据赛事id查询比赛详情")
+    public Result<AppGame> findScoreByGameId(@RequestParam("id") String id){
+        return iGameService.findScoreByGameId(id);
+    }
 }

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IGameService.java

@@ -6,6 +6,7 @@ import org.jeecg.modules.app.vo.game.FindByGameIdPriceVo;
 import org.jeecg.modules.app.vo.game.FindByIdResponse;
 import org.jeecg.modules.app.vo.game.FindPagResponse;
 import org.jeecg.modules.app.vo.game.FindPageGameVO;
+import org.jeecg.modules.system.app.entity.AppGame;
 
 /**
  * @Description: 赛事表
@@ -22,4 +23,6 @@ public interface IGameService {
 
 
     Result<FindByGameIdPriceVo> findByGameId(String id);
+
+    Result<AppGame> findScoreByGameId(String id);
 }

+ 12 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/GameServiceImpl.java

@@ -11,6 +11,7 @@ import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.util.DictAnnotationUtil;
 import org.jeecg.modules.app.service.IGameService;
 import org.jeecg.modules.app.vo.game.*;
+import org.jeecg.modules.system.app.entity.AppGame;
 import org.jeecg.modules.system.app.entity.AppInsure;
 import org.jeecg.modules.system.app.entity.InsurePrice;
 import org.jeecg.modules.system.app.mapper.*;
@@ -156,6 +157,17 @@ public class GameServiceImpl  implements IGameService {
         return Result.OK(findByGameIdPriceVo);
     }
 
+    @Override
+    public Result<AppGame> findScoreByGameId(String id) {
+        AppGame appGame = appGameMapper.selectById(id);
+        if (appGame==null){
+            return Result.error("请确认所查询需要的数据是否存在");
+        }
+        if (StringUtils.isEmpty(appGame.getGameResults())){
+            return Result.error("该赛事成绩未出来");
+        }
+        return Result.ok(appGame);
+    }
 
 
 }