ClassGroupController.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.ym.mec.education.controller;
  2. import com.ym.mec.education.base.BaseResponse;
  3. import com.ym.mec.education.enums.ReturnCodeEnum;
  4. import com.ym.mec.education.req.ClassGroupReq;
  5. import com.ym.mec.education.service.IClassGroupService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import lombok.extern.slf4j.Slf4j;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import java.util.Objects;
  15. /**
  16. * @program: mec
  17. * @description: 班级
  18. * @author: xw
  19. * @create: 2019-09-26 14:03
  20. */
  21. @RestController
  22. @RequestMapping("api/classGroup")
  23. @Api(tags = "班级")
  24. @Slf4j
  25. public class ClassGroupController {
  26. @Autowired
  27. private IClassGroupService classGroupService;
  28. @PostMapping("/info")
  29. @ApiOperation("班级详情")
  30. public BaseResponse getInfo(@RequestBody ClassGroupReq classGroupReq) {
  31. if (Objects.isNull(classGroupReq.getGroupId())) {
  32. BaseResponse baseResponse = new BaseResponse();
  33. baseResponse.setReturnCode(ReturnCodeEnum.CODE_206.getCode());
  34. baseResponse.setMessage(ReturnCodeEnum.CODE_206.getValue());
  35. return baseResponse;
  36. }
  37. return classGroupService.getInfo(classGroupReq);
  38. }
  39. }