|
@@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.AuthOperaDto;
|
|
import com.yonge.cooleshow.biz.dal.dto.RealnameAuthDto;
|
|
import com.yonge.cooleshow.biz.dal.dto.RealnameAuthDto;
|
|
import com.yonge.cooleshow.biz.dal.dto.TeacherApplyDetailDto;
|
|
import com.yonge.cooleshow.biz.dal.dto.TeacherApplyDetailDto;
|
|
import com.yonge.cooleshow.biz.dal.support.Condition;
|
|
import com.yonge.cooleshow.biz.dal.support.Condition;
|
|
import com.yonge.cooleshow.biz.dal.support.Query;
|
|
import com.yonge.cooleshow.biz.dal.support.Query;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
|
+import com.yonge.cooleshow.common.page.PageInfo;
|
|
import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
|
|
import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
|
|
import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
|
|
import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
|
|
import com.yonge.toolset.utils.idcard.IdcardValidator;
|
|
import com.yonge.toolset.utils.idcard.IdcardValidator;
|
|
@@ -23,8 +26,6 @@ import lombok.AllArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
|
-
|
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
|
|
import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
|
|
import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
|
|
|
|
|
|
@@ -40,9 +41,10 @@ public class TeacherAuthEntryRecordController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private RealnameAuthenticationPlugin realnameAuthenticationPlugin;
|
|
private RealnameAuthenticationPlugin realnameAuthenticationPlugin;
|
|
|
|
|
|
- @GetMapping("/realnameAuth")
|
|
|
|
|
|
+ @PostMapping("/realnameAuth")
|
|
@ApiOperation(value = "实名认证", notes = "传入realnameAuthDto")
|
|
@ApiOperation(value = "实名认证", notes = "传入realnameAuthDto")
|
|
- public HttpResponseResult<IdcardInfoExtractor> realnameAuth(RealnameAuthDto realnameAuthDto) {
|
|
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public HttpResponseResult<IdcardInfoExtractor> realnameAuth(@RequestBody RealnameAuthDto realnameAuthDto) {
|
|
IdcardValidator idcardValidator = new IdcardValidator();
|
|
IdcardValidator idcardValidator = new IdcardValidator();
|
|
//验证身份证号合法性
|
|
//验证身份证号合法性
|
|
boolean validatedAllIdcard = idcardValidator.isValidatedAllIdcard(realnameAuthDto.getIdcardNo());
|
|
boolean validatedAllIdcard = idcardValidator.isValidatedAllIdcard(realnameAuthDto.getIdcardNo());
|
|
@@ -59,35 +61,12 @@ public class TeacherAuthEntryRecordController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @GetMapping("/doApply")
|
|
|
|
|
|
+ @PostMapping("/doApply")
|
|
@ApiOperation(value = "提交申请", notes = "传入teacherAuthEntryRecord")
|
|
@ApiOperation(value = "提交申请", notes = "传入teacherAuthEntryRecord")
|
|
- public HttpResponseResult<Boolean> doApply(TeacherApplyDetailDto teacherApplyDetailDto) {
|
|
|
|
|
|
+ public HttpResponseResult<Boolean> doApply(TeacherApplyDetailDto teacherApplyDetailDto) throws Exception{
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
//处理老师申请逻辑
|
|
//处理老师申请逻辑
|
|
- Boolean b = teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, sysUser);
|
|
|
|
- return succeed(b);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询单条
|
|
|
|
- */
|
|
|
|
- @GetMapping("/detail")
|
|
|
|
- @ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
|
|
|
|
- public HttpResponseResult<TeacherAuthEntryRecord> detail(TeacherAuthEntryRecord teacherAuthEntryRecord) {
|
|
|
|
- TeacherAuthEntryRecord detail = teacherAuthEntryRecordService.getOne(Condition.getQueryWrapper(teacherAuthEntryRecord));
|
|
|
|
- return succeed(detail);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询集合
|
|
|
|
- */
|
|
|
|
- @GetMapping("/list")
|
|
|
|
- @ApiOperation(value = "查询集合", notes = "传入teacherAuthEntryRecord")
|
|
|
|
- public HttpResponseResult<List<TeacherAuthEntryRecord>> list(TeacherAuthEntryRecord teacherAuthEntryRecord) {
|
|
|
|
- List<TeacherAuthEntryRecord> list = teacherAuthEntryRecordService.list();
|
|
|
|
- return succeed(list);
|
|
|
|
|
|
+ return teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, sysUser);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -95,36 +74,27 @@ public class TeacherAuthEntryRecordController extends BaseController {
|
|
*/
|
|
*/
|
|
@GetMapping("/page")
|
|
@GetMapping("/page")
|
|
@ApiOperation(value = "查询分页", notes = "传入teacherAuthEntryRecord")
|
|
@ApiOperation(value = "查询分页", notes = "传入teacherAuthEntryRecord")
|
|
- public HttpResponseResult<IPage<TeacherAuthEntryRecord>> page(TeacherAuthEntryRecord teacherAuthEntryRecord, Query query) {
|
|
|
|
- IPage<TeacherAuthEntryRecord> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(query), teacherAuthEntryRecord);
|
|
|
|
- return succeed(pages);
|
|
|
|
|
|
+ public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(TeacherAuthEntryRecord teacherAuthEntryRecord, Query query) {
|
|
|
|
+ IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(query), teacherAuthEntryRecord);
|
|
|
|
+ return succeed(Condition.pageInfo(pages));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 新增
|
|
|
|
|
|
+ * 查询单条详情
|
|
*/
|
|
*/
|
|
- @PostMapping("/save")
|
|
|
|
- @ApiOperation(value = "新增", notes = "传入teacherAuthEntryRecord")
|
|
|
|
- public HttpResponseResult save(@Valid @RequestBody TeacherAuthEntryRecord teacherAuthEntryRecord) {
|
|
|
|
- return status(teacherAuthEntryRecordService.save(teacherAuthEntryRecord));
|
|
|
|
|
|
+ @GetMapping("/detail")
|
|
|
|
+ @ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
|
|
|
|
+ public HttpResponseResult<TeacherAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
|
|
|
|
+ TeacherAuthEntryRecordVo detail = teacherAuthEntryRecordService.detail(id);
|
|
|
|
+ return succeed(detail);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 修改
|
|
|
|
- */
|
|
|
|
- @PostMapping("/update")
|
|
|
|
- @ApiOperation(value = "修改", notes = "传入teacherAuthEntryRecord")
|
|
|
|
- public HttpResponseResult update(@Valid @RequestBody TeacherAuthEntryRecord teacherAuthEntryRecord) {
|
|
|
|
- return status(teacherAuthEntryRecordService.updateById(teacherAuthEntryRecord));
|
|
|
|
- }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * 新增或修改
|
|
|
|
- */
|
|
|
|
- @PostMapping("/submit")
|
|
|
|
- @ApiOperation(value = "新增或修改", notes = "传入teacherAuthEntryRecord")
|
|
|
|
- public HttpResponseResult submit(@RequestBody TeacherAuthEntryRecord teacherAuthEntryRecord) {
|
|
|
|
- return status(teacherAuthEntryRecordService.saveOrUpdate(teacherAuthEntryRecord));
|
|
|
|
|
|
+ @PostMapping("/doAuth")
|
|
|
|
+ @ApiOperation(value = "审核", notes = "传入authOperaDto")
|
|
|
|
+ public HttpResponseResult<Boolean> doAuth(AuthOperaDto authOperaDto) throws Exception{
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ return teacherAuthEntryRecordService.doAuth(authOperaDto, sysUser);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|