|
@@ -0,0 +1,156 @@
|
|
|
+package com.ym.mec.teacher.controller;
|
|
|
+
|
|
|
+import com.ym.mec.biz.dal.dto.ImLiveBroadcastRoomDto;
|
|
|
+import com.ym.mec.biz.dal.dto.RoomReservationUserSearch;
|
|
|
+import com.ym.mec.biz.dal.page.LiveRoomGoodsOrderQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
|
|
|
+import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
|
|
|
+import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
|
|
|
+import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
|
|
|
+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 com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.common.page.WrapperUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 直播房间管理表(ImLiveBroadcastRoom)表控制层
|
|
|
+ *
|
|
|
+ * @author hgw
|
|
|
+ * @since 2022-02-17 20:52:04
|
|
|
+ */
|
|
|
+@Api(tags = "直播房间管理表")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/imLiveBroadcastRoom")
|
|
|
+public class TeacherImLiveBroadcastRoomController extends BaseController {
|
|
|
+ /**
|
|
|
+ * 服务对象
|
|
|
+ */
|
|
|
+ @Resource
|
|
|
+ private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
|
|
|
+
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "search", dataType = "String", value = "模糊查询关键字"),
|
|
|
+ @ApiImplicitParam(name = "liveState", dataType = "Integer", value = "直播状态 0未开始 1开始 2结束"),
|
|
|
+ @ApiImplicitParam(name = "startTime", dataType = "String", value = "开始时间"),
|
|
|
+ @ApiImplicitParam(name = "endTime", dataType = "String", value = "结束时间"),
|
|
|
+ @ApiImplicitParam(name = "popularize", dataType = "Integer", value = "是否在首页推广 0否 1是"),
|
|
|
+ @ApiImplicitParam(name = "speakerId", dataType = "Integer", value = "老师ID"),
|
|
|
+ @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
|
|
|
+ @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
|
|
|
+ })
|
|
|
+ @ApiOperation("分页查询直播间列表")
|
|
|
+ @PostMapping("/queryPage")
|
|
|
+ public HttpResponseResult<PageInfo<ImLiveBroadcastRoomVo>> queryPage(@RequestBody Map<String, Object> param) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.queryPage(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "search", dataType = "String", value = "模糊查询关键字"),
|
|
|
+ @ApiImplicitParam(name = "subjectId", dataType = "Integer", value = "声部id"),
|
|
|
+ @ApiImplicitParam(name = "organId", dataType = "Integer", value = "分部id"),
|
|
|
+ @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
|
|
|
+ @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
|
|
|
+ })
|
|
|
+ @ApiOperation("直播间预约人员信息")
|
|
|
+ @PostMapping("/query/roomUser")
|
|
|
+ public HttpResponseResult<PageInfo<RoomReservationUserVo>> queryRoomUser(@RequestBody @Valid RoomReservationUserSearch query) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.queryRoomUser(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "search", dataType = "String", value = "模糊查询关键字"),
|
|
|
+ @ApiImplicitParam(name = "subjectId", dataType = "Integer", value = "声部id"),
|
|
|
+ @ApiImplicitParam(name = "organId", dataType = "Integer", value = "分部id"),
|
|
|
+ })
|
|
|
+ @ApiOperation(value = "导出训练营详情")
|
|
|
+ @PostMapping(value = "/exportReservationRoomUser")
|
|
|
+ public void exportReservationRoomUser(@RequestBody RoomReservationUserSearch query, HttpServletResponse response) throws IOException {
|
|
|
+ imLiveBroadcastRoomService.exportReservationRoomUser(query, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询房间信息并校验房间是否合规")
|
|
|
+ @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));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关闭直播间
|
|
|
+ *
|
|
|
+ * @param id 房间表id
|
|
|
+ */
|
|
|
+ @ApiOperation("关闭直播间")
|
|
|
+ @GetMapping(value = "/roomDestroy/{id}")
|
|
|
+ public HttpResponseResult<Object> roomDestroy(@ApiParam(value = "房间表id", required = true) @PathVariable("id") Integer id) {
|
|
|
+ imLiveBroadcastRoomService.roomDestroy(id);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("推广直播间-每个机构只能有一个直播间在首页推广")
|
|
|
+ @GetMapping("/opsPopularize")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/opsPopularize')")
|
|
|
+ public HttpResponseResult<Object> opsPopularize(@ApiParam(value = "房间id", required = true) Integer id,
|
|
|
+ @ApiParam(value = "是否在首页推广 0否 1是", required = true) Integer popularize) {
|
|
|
+ imLiveBroadcastRoomService.opsPopularize(id, popularize);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @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));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/test")
|
|
|
+ public Object test(String roomUid) {
|
|
|
+ return imLiveBroadcastRoomService.test(roomUid);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/shareGroup")
|
|
|
+ public HttpResponseResult<Object> shareGroup(@ApiParam(value = "房间uid", required = true) String roomUid,
|
|
|
+ @ApiParam(value = "群编号", required = true) String groupIds) {
|
|
|
+ imLiveBroadcastRoomService.shareGroup(roomUid, groupIds);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取房间人员")
|
|
|
+ @GetMapping("/queryRoomUserInfo")
|
|
|
+ public HttpResponseResult<List<BaseRoomUserVo>> queryRoomUserInfo(@ApiParam(value = "房间uid", required = true) String roomUid) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.queryRoomLimitOnlineUserInfo(roomUid));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询直播间商品订单列表")
|
|
|
+ @GetMapping("/queryLiveRoomGoodsOrderList")
|
|
|
+ public HttpResponseResult<PageInfo<LiveRoomGoodsOrderVo>> queryLiveRoomGoodsOrderList(LiveRoomGoodsOrderQueryInfo queryInfo) {
|
|
|
+ return succeed(imLiveBroadcastRoomService.queryLiveRoomGoodsOrderList(queryInfo));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|