增加手机+密码+验证码注册方式
This commit is contained in:
parent
680a39acbf
commit
3a8ebd6add
@ -8,10 +8,7 @@ import ink.wgink.interfaces.consts.ISystemConstant;
|
|||||||
import ink.wgink.interfaces.sms.ISmsBaseService;
|
import ink.wgink.interfaces.sms.ISmsBaseService;
|
||||||
import ink.wgink.pojo.result.ErrorResult;
|
import ink.wgink.pojo.result.ErrorResult;
|
||||||
import ink.wgink.pojo.result.SuccessResult;
|
import ink.wgink.pojo.result.SuccessResult;
|
||||||
import ink.wgink.register.base.pojo.vos.RegisterDefaultVO;
|
import ink.wgink.register.base.pojo.vos.*;
|
||||||
import ink.wgink.register.base.pojo.vos.RegisterDefaultWithExpandInfoVO;
|
|
||||||
import ink.wgink.register.base.pojo.vos.RegisterPhoneVO;
|
|
||||||
import ink.wgink.register.base.pojo.vos.RegisterPhoneWithExpandInfoVO;
|
|
||||||
import ink.wgink.register.base.service.IRegisterService;
|
import ink.wgink.register.base.service.IRegisterService;
|
||||||
import ink.wgink.util.RegexUtil;
|
import ink.wgink.util.RegexUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -69,6 +66,26 @@ public class RegisterAppController extends DefaultBaseController {
|
|||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "手机密码注册", notes = "手机注册,手机 + 短信验证码 + 密码接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("phone-password")
|
||||||
|
@CheckRequestBodyAnnotation
|
||||||
|
public synchronized SuccessResult phonePassword(@RequestBody RegisterPhonePasswordVO registerPhonePasswordVO) throws Exception {
|
||||||
|
checkPhoneRegisterParams(registerPhonePasswordVO);
|
||||||
|
if (!StringUtils.equals(registerPhonePasswordVO.getPassword(), registerPhonePasswordVO.getPasswordSame())) {
|
||||||
|
throw new ParamsException("两次密码不一致");
|
||||||
|
}
|
||||||
|
if (!RegexUtil.isPasswordMiddle(registerPhonePasswordVO.getPassword())) {
|
||||||
|
throw new ParamsException("密码强度不够, 密码6到16位,包含数字、字母、特殊字符,其中的任意两种");
|
||||||
|
}
|
||||||
|
Map<String, Object> params = requestParams();
|
||||||
|
RegisterDefaultVO registerDefaultVO = new RegisterDefaultVO();
|
||||||
|
registerDefaultVO.setUsername(registerPhonePasswordVO.getPhone());
|
||||||
|
registerDefaultVO.setPassword(registerPhonePasswordVO.getPassword());
|
||||||
|
registerService.registerDefault(registerDefaultVO, params);
|
||||||
|
return new SuccessResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "默认注册(有拓展信息)", notes = "默认注册(有拓展信息),用户名密码注册接口")
|
@ApiOperation(value = "默认注册(有拓展信息)", notes = "默认注册(有拓展信息),用户名密码注册接口")
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package ink.wgink.register.base.pojo.vos;
|
||||||
|
|
||||||
|
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: RegisterPhonePasswordVO
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2023/3/15 16:20
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class RegisterPhonePasswordVO extends RegisterPhoneVO{
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "password", value = "密码")
|
||||||
|
@CheckEmptyAnnotation(name = "密码")
|
||||||
|
private String password;
|
||||||
|
@ApiModelProperty(name = "passwordSame", value = "相同密码")
|
||||||
|
@CheckEmptyAnnotation(name = "passwordSame")
|
||||||
|
private String passwordSame;
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password == null ? "" : password.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordSame() {
|
||||||
|
return passwordSame == null ? "" : passwordSame.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPasswordSame(String passwordSame) {
|
||||||
|
this.passwordSame = passwordSame;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user