新增 CommonResult 。
将使用手机号进行注册登陆的逻辑,进行变更~
This commit is contained in:
@@ -2,8 +2,9 @@ package cn.iocoder.mall.user.service.api;
|
||||
|
||||
|
||||
import cn.iocoder.common.framework.exception.ServiceException;
|
||||
import cn.iocoder.mall.user.service.api.dto.OAuth2AccessTokenBO;
|
||||
import cn.iocoder.mall.user.service.api.dto.OAuth2AuthenticationDTO;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.user.service.api.bo.OAuth2AccessTokenBO;
|
||||
import cn.iocoder.mall.user.service.api.bo.OAuth2AuthenticationBO;
|
||||
|
||||
public interface OAuth2Service {
|
||||
|
||||
@@ -19,13 +20,15 @@ public interface OAuth2Service {
|
||||
OAuth2AccessTokenBO getAccessToken(String mobile, String code)
|
||||
throws ServiceException;
|
||||
|
||||
CommonResult<OAuth2AccessTokenBO> getAccessToken2(String mobile, String code);
|
||||
|
||||
/**
|
||||
* 校验访问令牌,获取身份信息( 不包括 accessToken 等等 )
|
||||
*
|
||||
* @param accessToken 访问令牌
|
||||
* @return 授权信息
|
||||
*/
|
||||
OAuth2AuthenticationDTO checkToken(String accessToken)
|
||||
OAuth2AuthenticationBO checkToken(String accessToken)
|
||||
throws ServiceException;
|
||||
|
||||
// @see 刷新 token
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package cn.iocoder.mall.user.service.api;
|
||||
|
||||
import cn.iocoder.common.framework.exception.ServiceException;
|
||||
import cn.iocoder.mall.user.service.api.dto.UserDTO;
|
||||
import cn.iocoder.mall.user.service.api.bo.UserBO;
|
||||
|
||||
public interface UserService {
|
||||
|
||||
/**
|
||||
* 创建用户。一般在用户注册时,调用该方法
|
||||
*
|
||||
* TODO 芋艿,此处要传递一些用户注册时的相关信息,例如说 ip、ua、客户端来源等等。用于数据分析、风控等等。
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param code 手机验证码
|
||||
* @return 用户
|
||||
*/
|
||||
UserDTO createUser(String mobile, String code) throws ServiceException;
|
||||
UserBO createUser(String mobile, String code) throws ServiceException;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.user.service.api.dto;
|
||||
package cn.iocoder.mall.user.service.api.bo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.mall.user.service.api.dto;
|
||||
package cn.iocoder.mall.user.service.api.bo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class OAuth2AuthenticationDTO implements Serializable {
|
||||
public class OAuth2AuthenticationBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
@@ -13,7 +13,7 @@ public class OAuth2AuthenticationDTO implements Serializable {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public OAuth2AuthenticationDTO setUid(Long uid) {
|
||||
public OAuth2AuthenticationBO setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.mall.user.service.api.dto;
|
||||
package cn.iocoder.mall.user.service.api.bo;
|
||||
|
||||
public class UserDTO {
|
||||
public class UserBO {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
@@ -15,7 +15,7 @@ public class UserDTO {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public UserDTO setUid(Long uid) {
|
||||
public UserBO setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class UserDTO {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public UserDTO setMobile(String mobile) {
|
||||
public UserBO setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
return this;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package cn.iocoder.mall.user.service.api.dto;
|
||||
|
||||
public class MobileCodeDTO {
|
||||
|
||||
private String code;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public MobileCodeDTO setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user