浏览代码

feat(game-event): 添加赛事直播链接查询功能

- 移除未使用的 GameScoreMapper 依赖
- 添加 GameEventConfigMapper 依赖用于配置查询
- 注释掉个人信息修改接口预留位置
- 新增富文本统一查询接口预留位置
- 实现 /live 接口通过 eventId 查询赛事直播链接
- 添加根据 eventId 和 key 查询配置值的数据库方法
zhou 1 周之前
父节点
当前提交
43660a34de

+ 29 - 1
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/app/ExperienceVersionController.java

@@ -36,8 +36,8 @@ public class ExperienceVersionController {
     private final GameUserMapper gameUserMapper;
     private final GameEventProjectMapper projectMapper;
     private final GameEventGroupMapper groupMapper;
-    private final GameScoreMapper scoreMapper;
     private final IGameScoreService gameScoreService;
+    private final GameEventConfigMapper eventConfigMapper;
 
     /**
      * 1、登录接口(微信小程序授权登录)
@@ -102,6 +102,14 @@ public class ExperienceVersionController {
         return R.ok(TenantHelper.ignore(() -> userEventService.getExperienceMyRecord(phone.trim())));
     }
 
+    /**
+     * 6、我的---个人信息修改
+     */
+//    @PostMapping("/updateInfo")
+//    public R<Boolean> updateInfo(@RequestBody @Validated ExperienceUpdateInfoBo updateInfoBo) {
+//
+//    }
+
     /**
      * 7、赛事菜单查询接口
      */
@@ -168,4 +176,24 @@ public class ExperienceVersionController {
         return R.ok(TenantHelper.ignore(() -> gameScoreService.getExRankingBoardData(eventId, projectId, classification)));
     }
 
+    /**
+     * 14、富文本统一查询接口
+     */
+//    @GetMapping("/richText")
+
+    /**
+     * 15、赛事直播链接--liveUrl
+     */
+    @GetMapping("/live")
+    public R<String> getLiveUrl(@RequestParam("eventId") Long eventId) {
+        if (eventId == null) {
+            return R.fail("赛事Id不能为空");
+        }
+        String liveUrl = TenantHelper.ignore(() -> eventConfigMapper.selectValueByKey(eventId, "liveUrl"));
+        if (StringUtils.isBlank(liveUrl)) {
+            return R.fail("未找到该赛事的直播链接");
+        }
+        return R.ok("操作成功", liveUrl);
+    }
+
 }

+ 7 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/mapper/GameEventConfigMapper.java

@@ -3,6 +3,7 @@ package org.dromara.system.mapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 import org.dromara.common.mybatis.annotation.DataColumn;
 import org.dromara.common.mybatis.annotation.DataPermission;
 import org.dromara.system.domain.GameEventConfig;
@@ -40,4 +41,10 @@ public interface GameEventConfigMapper extends BaseMapperPlus<GameEventConfig, G
     default List<GameEventConfigVo> selectEventConfigList(Wrapper<GameEventConfig> queryWrapper) {
         return this.selectVoList(queryWrapper);
     }
+
+    /**
+     * 根据key获取value
+     */
+    @Select("select config_value from game_event_config where event_id = #{eventId} and config_key = #{key}")
+    String selectValueByKey(Long eventId, String key);
 }