用户的功能迁移
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.vo.OAuth2AccessTokenVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
|
||||
public interface OAuth2Rpc {
|
||||
|
||||
CommonResult<OAuth2AccessTokenVO> createAccessToken(OAuth2CreateAccessTokenDTO createAccessTokenDTO);
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2CreateAccessTokenReqDTO createAccessTokenDTO);
|
||||
|
||||
CommonResult<OAuth2AccessTokenVO> checkAccessToken(String accessToken);
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(String accessToken);
|
||||
|
||||
CommonResult<OAuth2AccessTokenVO> refreshAccessToken(OAuth2RefreshAccessTokenDTO refreshAccessTokenDTO);
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO);
|
||||
|
||||
CommonResult<Boolean> removeToken(OAuth2RemoveTokenByUserReqDTO removeTokenDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth.vo;
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -7,11 +7,11 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* OAuth2.0 访问令牌 VO
|
||||
* OAuth2.0 访问令牌 Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2AccessTokenVO implements Serializable {
|
||||
public class OAuth2AccessTokenRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 访问令牌
|
||||
@@ -1,28 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* OAuth2.0 访问令牌创建 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2CreateAccessTokenDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private Integer userType;
|
||||
/**
|
||||
* 创建 IP
|
||||
*/
|
||||
private String createIp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.UserTypeEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* OAuth2.0 访问令牌创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2CreateAccessTokenReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
@InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}")
|
||||
private Integer userType;
|
||||
/**
|
||||
* 创建 IP
|
||||
*/
|
||||
private String createIp;
|
||||
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* OAuth2.0 访问令牌创建 DTO
|
||||
* OAuth2.0 访问令牌创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2RefreshAccessTokenDTO implements Serializable {
|
||||
public class OAuth2RefreshAccessTokenReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 刷新令牌
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.UserTypeEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* OAuth2.0 移除用户令牌 Request DTO
|
||||
*
|
||||
* 包括访问令牌和刷新令牌
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2RemoveTokenByUserReqDTO {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
@InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}")
|
||||
private Integer userType;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user