Bläddra i källkod

fix直播助手查询

Eric 2 år sedan
förälder
incheckning
a5dec6f5d2

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -143,6 +143,11 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
             //老师端
             return teacherQueryRoomAndCheck(roomUid, sysUser);
         }
+
+        // 校验直播间是否存在
+        Optional.ofNullable(roomUid).map(this::queryRoomInfo)
+                .orElseThrow(() -> new BizException("直播间不存在"));
+
         return queryRoomAndCheck(roomUid, sysUser);
     }
 

+ 15 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherImLiveBroadcastRoomController.java

@@ -67,10 +67,23 @@ public class TeacherImLiveBroadcastRoomController extends BaseController {
     }
 
     @ApiOperation("查询房间信息并校验房间是否合规")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "房间uid", required = true),
+            @ApiImplicitParam(name = "userId", dataType = "Integer", value = "用户id", required = true),
+            @ApiImplicitParam(name = "liveAssistant", dataType = "Boolean", value = "直播助手"),
+    })
     @GetMapping("/queryRoom")
     public HttpResponseResult<ImLiveBroadcastRoomVo> queryRoomAndCheck(@ApiParam(value = "房间uid", required = true) String roomUid,
-                                                                       @ApiParam(value = "用户id", required = true) Integer userId) {
-        return succeed(imLiveBroadcastRoomService.queryRoomAndCheck(roomUid, userId, 2));
+                                                                       @ApiParam(value = "用户id", required = true) Integer userId,
+                                                                       @RequestParam(defaultValue = "false") Boolean liveAssistant) {
+
+        // 请求来源业源
+        int osType = 2; // 老师端
+        if (Optional.ofNullable(liveAssistant).orElse(false)) {
+            osType = 3; // 直播助手
+        }
+
+        return succeed(imLiveBroadcastRoomService.queryRoomAndCheck(roomUid, userId, osType));
     }
 
     @ApiOperation("关闭直播间")