package com.qmth.exam.reserve.controller.student; import com.qmth.boot.api.annotation.Aac; import com.qmth.boot.api.constant.ApiConstant; import com.qmth.exam.reserve.bean.student.StudentInfo; import com.qmth.exam.reserve.bean.student.WechatBindReq; import com.qmth.exam.reserve.controller.BaseController; import com.qmth.exam.reserve.service.StudentService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @Api(tags = "考生相关接口") @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/student") @Aac(strict = false, auth = true) public class StudentController extends BaseController { private static final Logger log = LoggerFactory.getLogger(StudentController.class); @Autowired private StudentService studentService; @ApiOperation(value = "考生账号与微信号绑定") @PostMapping(value = "/wechat/binding") public void binding(@RequestBody WechatBindReq req) { req.setStudentId(curLoginStudent().getId()); studentService.bindingWechat(req); } @ApiOperation(value = "考生账号与微信号解绑") @PostMapping(value = "/wechat/unbind") public void unbind() { studentService.unbindWechatByStudentId(curLoginStudent().getId()); } @ApiOperation(value = "获取考生信息") @PostMapping(value = "/info") public StudentInfo info() { return studentService.findInfoByStudentId(curLoginStudent().getId()); } }