HereWhiteController.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.ym.controller;
  2. import com.ym.mec.common.controller.BaseController;
  3. import com.ym.service.HereWhiteService;
  4. import org.apache.commons.lang3.StringUtils;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestMethod;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @RestController
  10. @RequestMapping("/hereWhite")
  11. public class HereWhiteController extends BaseController {
  12. @Autowired
  13. private HereWhiteService hereWhiteService;
  14. /**
  15. * 创建白板,默认全部采用零时白板
  16. * @param name 白板名称
  17. * @param userNum 白板人数上限,0不限制
  18. * @param courseScheduleId 课程编号
  19. * @return
  20. * @throws Exception
  21. */
  22. @RequestMapping(value = "create", method = RequestMethod.POST)
  23. public Object userAdd(String name,Integer userNum,Integer courseScheduleId) throws Exception {
  24. if(StringUtils.isEmpty(name) || userNum == null || courseScheduleId == null){
  25. return failed("参数校验失败");
  26. }
  27. return succeed(hereWhiteService.create(name, userNum,courseScheduleId));
  28. }
  29. /**
  30. * 获取特定白板详情
  31. * @param courseScheduleId 课程编号
  32. * @return
  33. * @throws Exception
  34. */
  35. @RequestMapping(value = "get", method = RequestMethod.GET)
  36. public Object join(Integer courseScheduleId){
  37. return succeed(hereWhiteService.getByClassId(courseScheduleId));
  38. }
  39. }