StudentController.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package com.qmth.exam.reserve.controller.student;
  2. import com.qmth.boot.api.annotation.Aac;
  3. import com.qmth.boot.api.constant.ApiConstant;
  4. import com.qmth.exam.reserve.bean.student.StudentInfo;
  5. import com.qmth.exam.reserve.bean.student.WechatBindReq;
  6. import com.qmth.exam.reserve.controller.BaseController;
  7. import com.qmth.exam.reserve.service.StudentService;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. @RestController
  18. @Api(tags = "考生相关接口")
  19. @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/student")
  20. @Aac(strict = false, auth = true)
  21. public class StudentController extends BaseController {
  22. private static final Logger log = LoggerFactory.getLogger(StudentController.class);
  23. @Autowired
  24. private StudentService studentService;
  25. @ApiOperation(value = "考生账号与微信号绑定")
  26. @PostMapping(value = "/wechat/binding")
  27. public void binding(@RequestBody WechatBindReq req) {
  28. req.setStudentId(curLoginStudent().getId());
  29. studentService.bindingWechat(req);
  30. }
  31. @ApiOperation(value = "考生账号与微信号解绑")
  32. @PostMapping(value = "/wechat/unbind")
  33. public void unbind() {
  34. studentService.unbindWechatByStudentId(curLoginStudent().getId());
  35. }
  36. @ApiOperation(value = "获取考生信息")
  37. @PostMapping(value = "/info")
  38. public StudentInfo info() {
  39. return studentService.findInfoByStudentId(curLoginStudent().getId());
  40. }
  41. }