|
@@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
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.TeacherApplyDetailDto;
|
|
|
-import com.yonge.cooleshow.biz.dal.dto.req.TeacherAuthEntryRecordSearch;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.req.RealnameAuthReq;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.req.TeacherApplyDetailReq;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.search.TeacherAuthEntryRecordSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.support.Condition;
|
|
|
import com.yonge.cooleshow.biz.dal.support.Query;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
|
|
@@ -17,11 +17,10 @@ import com.yonge.cooleshow.common.page.PageInfo;
|
|
|
import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
|
|
|
import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
|
|
|
import com.yonge.toolset.utils.idcard.IdcardValidator;
|
|
|
-import com.yonge.toolset.utils.string.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
|
|
@@ -42,7 +41,11 @@ public class TeacherAuthEntryRecordController extends BaseController {
|
|
|
@PostMapping("/realNameAuth")
|
|
|
@ApiOperation(value = "实名认证", notes = "传入realNameAuthDto")
|
|
|
@ResponseBody
|
|
|
- public HttpResponseResult<IdcardInfoExtractor> realNameAuth(@Valid @RequestBody RealnameAuthDto realNameAuthDto) {
|
|
|
+ public HttpResponseResult<IdcardInfoExtractor> realNameAuth(@Valid @RequestBody RealnameAuthReq realNameAuthDto) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
IdcardValidator idcardValidator = new IdcardValidator();
|
|
|
//验证身份证号合法性
|
|
|
boolean validatedAllIdcard = idcardValidator.isValidatedAllIdcard(realNameAuthDto.getIdCardNo());
|
|
@@ -61,51 +64,12 @@ public class TeacherAuthEntryRecordController extends BaseController {
|
|
|
|
|
|
@PostMapping("/doApply")
|
|
|
@ApiOperation(value = "提交申请", notes = "传入teacherAuthEntryRecord")
|
|
|
- public HttpResponseResult<Boolean> doApply(@Valid @RequestBody TeacherApplyDetailDto teacherApplyDetailDto) throws Exception {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- //处理老师申请逻辑
|
|
|
- return teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, sysUser);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询分页
|
|
|
- */
|
|
|
- @GetMapping("/page")
|
|
|
- @ApiOperation(value = "查询分页", notes = "传入teacherAuthEntryRecord")
|
|
|
- public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(TeacherAuthEntryRecordSearch search, Query query) {
|
|
|
- IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(query), search);
|
|
|
- return succeed(Condition.pageInfo(pages));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询单条详情
|
|
|
- */
|
|
|
- @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("/doAuth")
|
|
|
- @ApiOperation(value = "审核", notes = "传入authOperaDto")
|
|
|
- public HttpResponseResult<Boolean> doAuth(@Valid AuthOperaDto authOperaDto) throws Exception {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- return teacherAuthEntryRecordService.doAuth(authOperaDto, sysUser);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- @PostMapping("/remove")
|
|
|
- @ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
- public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
- if (StringUtil.isEmpty(ids)) {
|
|
|
- return failed("参数不能为空");
|
|
|
+ public HttpResponseResult<Boolean> doApply(@Valid @RequestBody TeacherApplyDetailReq teacherApplyDetailDto) throws Exception {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
}
|
|
|
- return status(teacherAuthEntryRecordService.removeByIds(StringUtil.toLongList(ids)));
|
|
|
+ //处理老师申请逻辑
|
|
|
+ return teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, user);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|