|
@@ -4,14 +4,14 @@ import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
|
|
|
import com.ym.mec.biz.service.ImLiveBroadcastRoomService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import com.ym.mec.common.entity.ImUserState;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 直播房间管理表(ImLiveBroadcastRoom)表控制层
|
|
@@ -29,6 +29,12 @@ public class ImLiveBroadcastRoomController extends BaseController {
|
|
|
@Resource
|
|
|
private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
|
|
|
|
|
|
+ @ApiOperation("学生端-查询房间信息")
|
|
|
+ @GetMapping("/queryRoomInfo")
|
|
|
+ public HttpResponseResult<ImLiveBroadcastRoomVo> queryRoomInfo(@ApiParam(value = "房间uid", required = true) String roomUid) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.queryRoomInfo(roomUid));
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("查询该机构目前推广的直播间")
|
|
|
@GetMapping(value = "/queryPopularizeRoom")
|
|
|
public HttpResponseResult<ImLiveBroadcastRoomVo> queryPopularizeRoom() {
|
|
@@ -42,5 +48,48 @@ public class ImLiveBroadcastRoomController extends BaseController {
|
|
|
return succeed(imLiveBroadcastRoomService.queryRoomAndCheck(roomUid, userId, 1));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("同步点赞数量")
|
|
|
+ @GetMapping("/syncLike")
|
|
|
+ public HttpResponseResult<Object> syncLike(@ApiParam(value = "房间uid", required = true) String roomUid,
|
|
|
+ @ApiParam(value = "点赞数", required = true) Integer likeNum) {
|
|
|
+ imLiveBroadcastRoomService.syncLike(roomUid, likeNum);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/quitRoom")
|
|
|
+ public HttpResponseResult<Object> quitRoom(@RequestBody List<ImUserState> userState) {
|
|
|
+ imLiveBroadcastRoomService.opsRoom(userState);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("主讲人进入房间")
|
|
|
+ @GetMapping("/speakerJoinRoom")
|
|
|
+ public HttpResponseResult<ImLiveBroadcastRoomVo> speakerJoinRoom(String roomUid) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.speakerJoinRoom(roomUid));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("学生-进入房间")
|
|
|
+ @GetMapping("/joinRoom")
|
|
|
+ public HttpResponseResult<Object> joinRoom(String roomUid, Integer userId) {
|
|
|
+ imLiveBroadcastRoomService.joinRoom(roomUid, userId);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("开启/关闭直播的录像")
|
|
|
+ @GetMapping("/opsLiveVideo")
|
|
|
+ public HttpResponseResult<Object> opsLiveVideo(@ApiParam(value = "房间uid", required = true) String roomUid,
|
|
|
+ @ApiParam(value = "用户id", required = true) Integer userId,
|
|
|
+ @ApiParam(value = "type 1:开始直播-开始录像 2:关闭直播关闭录像", required = true) Integer type) {
|
|
|
+ if (type == 1) {
|
|
|
+ imLiveBroadcastRoomService.startLive(roomUid, userId);
|
|
|
+ } else if (type == 2) {
|
|
|
+ imLiveBroadcastRoomService.closeLive(roomUid, userId);
|
|
|
+ } else {
|
|
|
+ failed("type参数错误");
|
|
|
+ }
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|