|
@@ -3,7 +3,6 @@ package com.ym.controller;
|
|
|
import com.ym.common.ApiException;
|
|
|
import com.ym.common.BaseResponse;
|
|
|
import com.ym.common.ErrorEnum;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.pojo.*;
|
|
|
import com.ym.service.RoomService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,7 +15,7 @@ import java.util.List;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/room")
|
|
|
-public class RoomController extends BaseController {
|
|
|
+public class RoomController{
|
|
|
@Autowired
|
|
|
RoomService roomService;
|
|
|
|
|
@@ -24,43 +23,43 @@ public class RoomController extends BaseController {
|
|
|
public Object joinRoom(@RequestBody ReqUserData data)
|
|
|
throws ApiException, Exception {
|
|
|
RoomResult roomResult = roomService.joinRoom(data.getUserName(), data.getRoomId(), data.isAudience(), data.isDisableCamera());
|
|
|
- return succeed(new BaseResponse<>(roomResult));
|
|
|
+ return new BaseResponse<>(roomResult);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/leave", method = RequestMethod.POST)
|
|
|
public Object leaveRoom(@RequestBody ReqUserData data)
|
|
|
throws ApiException, Exception {
|
|
|
boolean result = roomService.leaveRoom(data.getRoomId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/downgrade", method = RequestMethod.POST)
|
|
|
public Object downRole(@RequestBody ReqChangeUserRoleData data)
|
|
|
throws ApiException, Exception {
|
|
|
boolean result = roomService.downgrade(data.getRoomId(), data.getUsers());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/kick", method = RequestMethod.POST)
|
|
|
public Object kickMember(@RequestBody ReqUserData data)
|
|
|
throws ApiException, Exception {
|
|
|
- boolean result = roomService.kickMember(data.getRoomId(), data.getUserId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ boolean result = roomService.kickMember(data.getRoomId());
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
//only teacher
|
|
|
@RequestMapping(value = "/display", method = RequestMethod.POST)
|
|
|
public Object display(@RequestBody ReqDisplayData data)
|
|
|
throws ApiException, Exception {
|
|
|
- boolean result = roomService.display(data.getRoomId(), data.getType(), data.getUserId(), data.getUri());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ boolean result = roomService.display(data.getRoomId(), data.getType(), data.getUri());
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/whiteboard/create", method = RequestMethod.POST)
|
|
|
public Object createWhiteBoard(@RequestBody ReqWhiteboardData data)
|
|
|
throws ApiException, Exception {
|
|
|
String result = roomService.createWhiteBoard(data.getRoomId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -68,14 +67,14 @@ public class RoomController extends BaseController {
|
|
|
public Object destroyWhiteBoard(@RequestBody ReqWhiteboardData data)
|
|
|
throws ApiException, Exception {
|
|
|
boolean result = roomService.deleteWhiteboard(data.getRoomId(), data.getWhiteboardId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/whiteboard/list", method = RequestMethod.GET)
|
|
|
public Object getWhiteBoard(@RequestParam String roomId)
|
|
|
throws ApiException, Exception {
|
|
|
List<RoomResult.WhiteboardResult> whiteboards = roomService.getWhiteboard(roomId);
|
|
|
- return succeed(new BaseResponse<>(whiteboards));
|
|
|
+ return new BaseResponse<>(whiteboards);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/device/approve", method = RequestMethod.POST)
|
|
@@ -83,7 +82,7 @@ public class RoomController extends BaseController {
|
|
|
throws ApiException, Exception {
|
|
|
boolean result;
|
|
|
result = roomService.approveControlDevice(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/device/reject", method = RequestMethod.POST)
|
|
@@ -91,7 +90,7 @@ public class RoomController extends BaseController {
|
|
|
throws ApiException, Exception {
|
|
|
boolean result;
|
|
|
result = roomService.rejectControlDevice(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/device/control", method = RequestMethod.POST)
|
|
@@ -105,7 +104,7 @@ public class RoomController extends BaseController {
|
|
|
} else {
|
|
|
throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
|
|
|
}
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/device/sync", method = RequestMethod.POST)
|
|
@@ -119,77 +118,77 @@ public class RoomController extends BaseController {
|
|
|
} else {
|
|
|
throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
|
|
|
}
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/whiteboard/turn-page", method = RequestMethod.POST)
|
|
|
public Object turnPage(@RequestBody ReqWhiteboardData data)
|
|
|
throws ApiException, Exception {
|
|
|
boolean result = roomService.turnWhiteBoardPage(data.getRoomId(), data.getWhiteboardId(), data.getPage());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/members", method = RequestMethod.GET)
|
|
|
public Object getMembers(@RequestParam String roomId)
|
|
|
throws ApiException, Exception {
|
|
|
List<RoomResult.MemberResult> whiteboards = roomService.getMembers(roomId);
|
|
|
- return succeed(new BaseResponse<>(whiteboards));
|
|
|
+ return new BaseResponse<>(whiteboards);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/speech/apply", method = RequestMethod.POST)
|
|
|
public Object apply(@RequestBody ReqSpeechData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.applySpeech(data.getRoomId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/speech/approve", method = RequestMethod.POST)
|
|
|
public Object approval(@RequestBody ReqSpeechData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.approveSpeech(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/speech/reject", method = RequestMethod.POST)
|
|
|
public Object reject(@RequestBody ReqSpeechData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.rejectSpeech(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/transfer", method = RequestMethod.POST)
|
|
|
public Object transfer(@RequestBody ReqUpgradeRoleData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.transfer(data.getRoomId(), data.getUserId());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/upgrade/invite", method = RequestMethod.POST)
|
|
|
public Object inviteUpgradeRole(@RequestBody ReqUpgradeRoleData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.inviteUpgradeRole(data.getRoomId(), data.getUserId(), data.getRole());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/upgrade/approve", method = RequestMethod.POST)
|
|
|
public Object approveUpgradeRole(@RequestBody ReqUpgradeRoleData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.approveUpgradeRole(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/upgrade/reject", method = RequestMethod.POST)
|
|
|
public Object rejectUpgradeRole(@RequestBody ReqUpgradeRoleData data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.rejectUpgradeRole(data.getRoomId(), data.getTicket());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/change-role", method = RequestMethod.POST)
|
|
|
public Object changeRole(@RequestBody ReqChangeRole data)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.changeRole(data.getRoomId(), data.getUserId(), data.getRole());
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/members/online-status", method = RequestMethod.POST)
|
|
@@ -199,6 +198,6 @@ public class RoomController extends BaseController {
|
|
|
@RequestParam(value = "signature", required = false) String signature)
|
|
|
throws ApiException, Exception {
|
|
|
Boolean result = roomService.memberOnlineStatus(statusList, nonce, timestamp, signature);
|
|
|
- return succeed(new BaseResponse<>(result));
|
|
|
+ return new BaseResponse<>(result);
|
|
|
}
|
|
|
}
|