|
@@ -12,6 +12,8 @@ import com.miaxis.common.core.domain.Response;
|
|
|
import com.miaxis.common.core.domain.entity.SysUser;
|
|
|
import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.enums.PictureType;
|
|
|
+import com.miaxis.common.exception.CustomException;
|
|
|
import com.miaxis.common.utils.SecurityUtils;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -69,7 +71,7 @@ public class UserInfoController extends BaseController{
|
|
|
/**
|
|
|
* 根据电话获取用户信息详细信息
|
|
|
*/
|
|
|
- @GetMapping(value = "/mobles/{mobile}")
|
|
|
+ @GetMapping(value = "mobles/{mobile}")
|
|
|
@ApiOperation("获取用户信息详细信息")
|
|
|
public Response<UserInfo> getInfo(
|
|
|
@ApiParam(name = "mobile", value = "用户电话", required = true)
|
|
@@ -104,15 +106,25 @@ public class UserInfoController extends BaseController{
|
|
|
* 上传身份证正反面,及人像图片
|
|
|
* uploadIdCardAndHeadPicture
|
|
|
*/
|
|
|
- @PostMapping("/uploadIdCardAndHeadPicture")
|
|
|
+ @PostMapping(Constants.OPEN_PREFIX + "/uploadIdCardAndHeadPicture")
|
|
|
@ApiOperation("上传身份证正反面,及人像图片")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "type",value = "idCardFront:身份证正面、idCardReverse:身份证反面、faces:人像" ,dataType = "String",required = true),
|
|
|
- // @ApiImplicitParam(name = "multFile", value = "上传文件", required = true, dataType = "MultipartFile")
|
|
|
+ @ApiImplicitParam(name = "type",value = "1:身份证正面 2:身份证反面 3:人脸比对模板(采集人像图)" ,dataType = "String",required = true),
|
|
|
+ @ApiImplicitParam(name = "multFile", value = "上传文件", required = true, dataType = "String")
|
|
|
})
|
|
|
public Response uploadIdCardAndHeadPicture(String type,MultipartFile multFile) throws IOException {
|
|
|
- String savePath = AliyunConfig.gzpt_user + type + "/"
|
|
|
- + new SimpleDateFormat("yyyyMMdd").format(new Date()) + "/";
|
|
|
+ String prefix = "";
|
|
|
+ if ("1".equals(type)){
|
|
|
+ prefix = PictureType.IDCARDFRONT.getPrefix();
|
|
|
+ }else if ("2".equals(type)){
|
|
|
+ prefix = PictureType.IDCARDREVERSE.getPrefix();
|
|
|
+ }else if ("3".equals(type)){
|
|
|
+ prefix = PictureType.FACES.getPrefix();
|
|
|
+ }else {
|
|
|
+ throw new CustomException("类型错误!");
|
|
|
+ }
|
|
|
+ String savePath = AliyunConfig.gzpt_user
|
|
|
+ + new SimpleDateFormat("yyyyMMdd").format(new Date()) + "/"+ prefix + "/";
|
|
|
String fileName = System.currentTimeMillis() + ".jpg";//文件名
|
|
|
String fileUrl = AliyunUpload.uploadForStream(multFile.getInputStream(), savePath, fileName);
|
|
|
FileVo fileVo = new FileVo();
|
|
@@ -126,7 +138,7 @@ public class UserInfoController extends BaseController{
|
|
|
* 删除文件
|
|
|
* uploadIdCardAndHeadPicture
|
|
|
*/
|
|
|
- @PostMapping("/deleteCardAndHeadPicture")
|
|
|
+ @PostMapping(Constants.OPEN_PREFIX + "/deleteCardAndHeadPicture")
|
|
|
@ApiOperation("删除文件")
|
|
|
@ApiImplicitParam(name = "filePath",value = "文件路径(filePath)" ,dataType = "String",required = true)
|
|
|
public Response deleteCardAndHeadPicture(String filePath) {
|
|
@@ -139,7 +151,7 @@ public class UserInfoController extends BaseController{
|
|
|
* 保存用户报名信息
|
|
|
* uploadIdCardAndHeadPicture
|
|
|
*/
|
|
|
- @PostMapping("/saveUserInformation")
|
|
|
+ @PostMapping(Constants.OPEN_PREFIX + "/saveUserInformation")
|
|
|
@ApiOperation("保存用户报名信息")
|
|
|
public Response saveUserInformation(UserDto userDto) {
|
|
|
|
|
@@ -150,7 +162,7 @@ public class UserInfoController extends BaseController{
|
|
|
* 注册报名获取短信验证码
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation("注册报名获取短信验证码")
|
|
|
+ @ApiOperation(Constants.OPEN_PREFIX + "注册报名获取短信验证码")
|
|
|
@ApiImplicitParam(name = "phone",value = "手机号码" ,dataType = "String",required = true)
|
|
|
@PostMapping(value = "/sendSignUpVerificationCode")
|
|
|
public Response sendSignUpVerificationCode(String phone){
|