Prechádzať zdrojové kódy

Merge branch 'dev_20230222_live' of http://git.dayaedu.com/yonge/mec into dev_20230222_live

liujunchi 2 rokov pred
rodič
commit
ee98e792c8

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -143,6 +143,18 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
             //老师端
             return teacherQueryRoomAndCheck(roomUid, sysUser);
         }
+
+        // 直播助手
+        if (osType == 3) {
+            // 校验直播间是否存在
+            ImLiveBroadcastRoomVo vo = Optional.ofNullable(roomUid).map(this::queryRoomInfo)
+                    .orElseThrow(() -> new BizException("直播间不存在"));
+
+            if (vo.getOs().equals("mobile")) {
+                throw new BizException("该直播间仅可在电脑端直播");
+            }
+        }
+
         return queryRoomAndCheck(roomUid, sysUser);
     }
 
@@ -165,7 +177,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
         ImLiveBroadcastRoomVo vo = Optional.ofNullable(roomUid).map(this::queryRoomInfo)
                 .orElseThrow(() -> new BizException("直播间不存在"));
         if (vo.getOs().equals("pc")) {
-            throw new BizException("该直播间仅可在电脑端直播");
+            throw new BizException("该直播间仅可在移动端直播");
         }
         return queryRoomAndCheck(vo, 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("关闭直播间")

+ 2 - 2
pom.xml

@@ -190,11 +190,11 @@
 				<version>1.3.2</version>
 			</dependency>
 
-			<dependency>
+			<!--<dependency>
 				<groupId>org.springframework.social</groupId>
 				<artifactId>spring-social-security</artifactId>
 				<version>1.1.6.RELEASE</version>
-			</dependency>
+			</dependency>-->
 
 			<dependency>
 				<groupId>commons-beanutils</groupId>