|
@@ -1,5 +1,20 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
@@ -11,14 +26,6 @@ import com.ym.mec.biz.service.ClassGroupService;
|
|
|
import com.ym.mec.biz.service.SubjectService;
|
|
|
import com.ym.mec.biz.service.TeacherService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
-import io.swagger.annotations.*;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import java.util.Date;
|
|
|
|
|
|
@RequestMapping("teacher")
|
|
|
@Api(tags = "教师服务")
|
|
@@ -48,6 +55,16 @@ public class TeacherController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据教师编号查询教师基本信息")
|
|
|
+ @GetMapping("/queryUserInfo")
|
|
|
+ public Object queryUserInfo() {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ return succeed(teacherService.get(user.getId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据教师编号查询教师基本信息")
|
|
|
@GetMapping("/get")
|
|
|
@ApiParam(value = "教师编号", required = true)
|
|
|
public Object get(Integer id) {
|
|
@@ -118,4 +135,19 @@ public class TeacherController extends BaseController {
|
|
|
public Object findSubByMusicGroupId(String musicGroupId){
|
|
|
return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "实名认证")
|
|
|
+ @ApiImplicitParams({ @ApiImplicitParam(name = "realName", value = "姓名", required = true, dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "idcardNo", value = "身份证号码", required = true, dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "idcardFrontImg", value = "身份证正面", required = true, dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "idcardBackImg", value = "身份证背面", required = true, dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "idcardHandImg", value = "手持身份证照", required = true, dataType = "String") })
|
|
|
+ public Object realNameAuthentication(String realName, String idcardNo, String idcardFrontImg, String idcardBackImg, String idcardHandImg) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ teacherService.realNameAuthentication(user.getId(), realName, idcardNo, idcardFrontImg, idcardBackImg, idcardHandImg);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
}
|