小程序获取手机号接口
This commit is contained in:
@@ -37,7 +37,12 @@ public class UserAuthorizationController {
|
|||||||
return CzgResult.success(userAuthorizationService.login(userAuthorizationLoginDTO));
|
return CzgResult.success(userAuthorizationService.login(userAuthorizationLoginDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
/**
|
||||||
|
* 获取手机号
|
||||||
|
* @param getPhoneDTO 获取手机号信息
|
||||||
|
* @return 手机号
|
||||||
|
*/
|
||||||
|
@PostMapping("/phone")
|
||||||
public CzgResult<String> getPhone(@RequestBody @Validated GetPhoneDTO getPhoneDTO) {
|
public CzgResult<String> getPhone(@RequestBody @Validated GetPhoneDTO getPhoneDTO) {
|
||||||
return CzgResult.success(userAuthorizationService.getPhone(getPhoneDTO));
|
return CzgResult.success(userAuthorizationService.getPhone(getPhoneDTO));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.czg.account.dto.auth;
|
package com.czg.account.dto.auth;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,8 +11,19 @@ public class GetPhoneDTO {
|
|||||||
/**
|
/**
|
||||||
* 来源 alipay支付宝 wechat微信
|
* 来源 alipay支付宝 wechat微信
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "来源不能为空")
|
||||||
private String source;
|
private String source;
|
||||||
|
/**
|
||||||
|
* 数据
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "数据不能为空")
|
||||||
private String encryptedData;
|
private String encryptedData;
|
||||||
|
/**
|
||||||
|
* 获取到的凭证code
|
||||||
|
*/
|
||||||
private String code;
|
private String code;
|
||||||
|
/**
|
||||||
|
* 仅微信传递
|
||||||
|
*/
|
||||||
private String iv;
|
private String iv;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user