main
parent
02b803730c
commit
6f591815c8
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author byw
|
* @author byw
|
||||||
|
|
@ -16,5 +17,6 @@ public class CodeArg {
|
||||||
|
|
||||||
@NotBlank(message = "手机号不能为空")
|
@NotBlank(message = "手机号不能为空")
|
||||||
@ApiModelProperty(value = "手机号")
|
@ApiModelProperty(value = "手机号")
|
||||||
|
@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ public class LoginController {
|
||||||
@NotLogin
|
@NotLogin
|
||||||
@ApiOperation("获取验证码")
|
@ApiOperation("获取验证码")
|
||||||
@PostMapping("/code")
|
@PostMapping("/code")
|
||||||
public AjaxResult<String> code(@RequestBody CodeArg arg){
|
public AjaxResult<String> code(@RequestBody @Validated CodeArg arg){
|
||||||
return iLoginService.code(arg.getMobile());
|
return iLoginService.code(arg.getMobile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ like:
|
||||||
# 是否开启swagger
|
# 是否开启swagger
|
||||||
enabled: true
|
enabled: true
|
||||||
# 请求前缀
|
# 请求前缀
|
||||||
pathMapping: /dev-api
|
pathMapping: /
|
||||||
|
|
||||||
# 服务配置
|
# 服务配置
|
||||||
server:
|
server:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue