Browse Source

1、企业实名添加参数验证

master
Aug 4 months ago
parent
commit
5791394b6f
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/CommonApiController.java

+ 32
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/CommonApiController.java View File

@ -182,6 +182,21 @@ public class CommonApiController {
@ApiOperation(value="我的服务-个人实名认证", notes="我的服务-个人实名认证") @ApiOperation(value="我的服务-个人实名认证", notes="我的服务-个人实名认证")
@RequestMapping(value = "/addAuthenticationPerson", method = {RequestMethod.POST}) @RequestMapping(value = "/addAuthenticationPerson", method = {RequestMethod.POST})
public Result<?> addAuthenticationPerson(@RequestHeader("X-Access-Token") String token, EmployAuthenticationPerson employAuthenticationPerson){ public Result<?> addAuthenticationPerson(@RequestHeader("X-Access-Token") String token, EmployAuthenticationPerson employAuthenticationPerson){
String message = null;
//参数校验
if(null == employAuthenticationPerson.getCerNo()){
message = "证件号码为空,请输入正确的证件号码";
}else if(null == employAuthenticationPerson.getName()){
message = "姓名为空,请输入姓名";
}else if(null == employAuthenticationPerson.getPhone()){
message = "联系方式为空,请输入手机号码";
}
//参数输入有误返回错误信息
if(null != message){
return Result.OK(message);
}
//业务处理
return commonApiService.addAuthenticationPerson(token, employAuthenticationPerson); return commonApiService.addAuthenticationPerson(token, employAuthenticationPerson);
} }
@ -189,6 +204,23 @@ public class CommonApiController {
@ApiOperation(value="我的服务-企业实名认证", notes="我的服务-企业实名认证") @ApiOperation(value="我的服务-企业实名认证", notes="我的服务-企业实名认证")
@RequestMapping(value = "/addAuthenticationCompany", method = {RequestMethod.POST}) @RequestMapping(value = "/addAuthenticationCompany", method = {RequestMethod.POST})
public Result<?> addAuthenticationCompany(@RequestHeader("X-Access-Token") String token, EmployAhthenticationCompany employAhthenticationCompany){ public Result<?> addAuthenticationCompany(@RequestHeader("X-Access-Token") String token, EmployAhthenticationCompany employAhthenticationCompany){
String message = null;
//参数校验
if(null == employAhthenticationCompany.getBusinessLicense()){
message = "营业执照未上传,请上传营业执照";
}else if(null == employAhthenticationCompany.getCompanyName()){
message = "企业名称为空,请填写企业名称";
}else if(null == employAhthenticationCompany.getLegalPerson()){
message = "法定代表人姓名为空,请填写法定代表人姓名";
}else if(null == employAhthenticationCompany.getCompanyAddress()){
message = "企业地址为空,请填写企业地址";
}
//参数输入有误返回错误信息
if(null != message){
return Result.OK(message);
}
//业务处理
return commonApiService.addAuthenticationCompany(token, employAhthenticationCompany); return commonApiService.addAuthenticationCompany(token, employAhthenticationCompany);
} }
// //


Loading…
Cancel
Save