|
@@ -1,6 +1,7 @@
|
|
|
package com.yonge.cooleshow.student.controller;
|
|
|
|
|
|
import com.yonge.cooleshow.biz.dal.entity.ImUserStateSync;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.ImGroupService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.LiveRoomService;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.liveroom.LiveRoomWrapper;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
@@ -8,6 +9,7 @@ import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -29,6 +31,9 @@ public class ImLiveBroadcastRoomController extends BaseController {
|
|
|
@Resource
|
|
|
private LiveRoomService liveRoomService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ImGroupService imGroupService;
|
|
|
+
|
|
|
@ApiOperation("学生端-查询房间信息")
|
|
|
@GetMapping("/queryRoomInfo")
|
|
|
public HttpResponseResult<LiveRoomWrapper.LiveRoomVo> queryRoomInfo(@ApiParam(value = "房间uid", required = true) String roomUid) {
|
|
@@ -39,32 +44,35 @@ public class ImLiveBroadcastRoomController extends BaseController {
|
|
|
@ApiOperation("查询房间信息并校验房间是否合规")
|
|
|
@GetMapping("/queryRoom")
|
|
|
public HttpResponseResult<LiveRoomWrapper.LiveRoomVo> queryRoomAndCheck(@ApiParam(value = "房间uid", required = true) String roomUid,
|
|
|
- @ApiParam(value = "用户id", required = true) Long userId) {
|
|
|
- return succeed(liveRoomService.queryRoomAndCheck(roomUid, userId, 1));
|
|
|
+ @ApiParam(value = "用户id", required = true) String userId) {
|
|
|
+ return succeed(liveRoomService.queryRoomAndCheck(roomUid, Long.parseLong(imGroupService.analysisImUserId(userId)), 1));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/quitRoom")
|
|
|
public HttpResponseResult<Object> quitRoom(@RequestBody List<ImUserStateSync> userState) {
|
|
|
+ for (ImUserStateSync stateSync : userState) {
|
|
|
+ stateSync.setUserid(imGroupService.analysisImUserId(stateSync.getUserid()));
|
|
|
+ }
|
|
|
liveRoomService.opsRoom(userState);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
@ApiOperation("学生-进入房间")
|
|
|
@GetMapping("/joinRoom")
|
|
|
- public HttpResponseResult<Object> joinRoom(String roomUid, Long userId,Boolean microphoneFlag) {
|
|
|
+ public HttpResponseResult<Object> joinRoom(String roomUid, String userId,Boolean microphoneFlag) {
|
|
|
if (microphoneFlag == null) {
|
|
|
microphoneFlag = true;
|
|
|
}
|
|
|
- liveRoomService.joinRoom(roomUid, userId,microphoneFlag);
|
|
|
+ liveRoomService.joinRoom(roomUid, Long.parseLong(imGroupService.analysisImUserId(userId)),microphoneFlag);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
@ApiOperation("设置连麦状态")
|
|
|
@PutMapping("/userWhetherMic")
|
|
|
public HttpResponseResult<Object> userWhetherMic(@ApiParam(value = "房间uid", required = true) String roomUid,
|
|
|
- @ApiParam(value = "用户id", required = true) Long userId,
|
|
|
+ @ApiParam(value = "用户id", required = true) String userId,
|
|
|
@ApiParam(value = "连麦状态 0:未申请1:申请连麦中2:连麦中", required = true) Integer whetherMicStatus) {
|
|
|
- liveRoomService.userWhetherMic(roomUid,userId,whetherMicStatus);
|
|
|
+ liveRoomService.userWhetherMic(roomUid,Long.parseLong(imGroupService.analysisImUserId(userId)),whetherMicStatus);
|
|
|
return succeed();
|
|
|
}
|
|
|
}
|