迁移 system 服务,admin 逻辑
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
package cn.iocoder.mall.system.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.api.bo.admin.AdminAuthenticationBO;
|
||||
import cn.iocoder.mall.system.api.bo.admin.AdminAuthorizationBO;
|
||||
import cn.iocoder.mall.system.api.bo.admin.AdminBO;
|
||||
import cn.iocoder.mall.system.api.bo.role.RoleBO;
|
||||
import cn.iocoder.mall.admin.api.dto.admin.*;
|
||||
import cn.iocoder.mall.system.api.dto.admin.*;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -17,16 +14,6 @@ import java.util.Map;
|
||||
*/
|
||||
public interface AdminService {
|
||||
|
||||
/**
|
||||
* 管理员认证。认证成功后,返回认证信息
|
||||
*
|
||||
* 实际上,就是用户名 + 密码登陆
|
||||
*
|
||||
* @param adminAuthenticationDTO 用户认证信息
|
||||
* @return 认证信息
|
||||
*/
|
||||
AdminAuthenticationBO authentication(AdminAuthenticationDTO adminAuthenticationDTO);
|
||||
|
||||
PageResult<AdminBO> getAdminPage(AdminPageDTO adminPageDTO);
|
||||
|
||||
AdminBO addAdmin(Integer adminId, AdminAddDTO adminAddDTO);
|
||||
@@ -62,13 +49,4 @@ public interface AdminService {
|
||||
*/
|
||||
Boolean assignAdminRole(Integer adminId, AdminAssignRoleDTO adminAssignRoleDTO);
|
||||
|
||||
/**
|
||||
* 判断管理员是否有指定权限
|
||||
*
|
||||
* @param adminId 管理员
|
||||
* @param permissions 权限数组
|
||||
* @return 管理员授权信息
|
||||
*/
|
||||
AdminAuthorizationBO checkPermissions(Integer adminId, List<String> permissions);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package cn.iocoder.mall.system.api;
|
||||
|
||||
import cn.iocoder.mall.system.api.bo.oauth2.OAuth2AccessTokenBO;
|
||||
import cn.iocoder.mall.system.api.bo.oauth2.OAuth2AuthenticationBO;
|
||||
import cn.iocoder.mall.system.api.dto.oauth2.OAuth2CreateTokenDTO;
|
||||
import cn.iocoder.mall.system.api.dto.oauth2.OAuth2GetTokenDTO;
|
||||
import cn.iocoder.mall.system.api.dto.oauth2.OAuth2RefreshTokenDTO;
|
||||
import cn.iocoder.mall.system.api.dto.oauth2.OAuth2RemoveTokenByUserDTO;
|
||||
|
||||
/**
|
||||
@@ -12,14 +7,6 @@ import cn.iocoder.mall.system.api.dto.oauth2.OAuth2RemoveTokenByUserDTO;
|
||||
*/
|
||||
public interface OAuth2Service {
|
||||
|
||||
/**
|
||||
* 根据身份信息,创建 accessToken 信息
|
||||
*
|
||||
* @param oauth2CreateTokenDTO 身份信息 DTO
|
||||
* @return accessToken 信息
|
||||
*/
|
||||
OAuth2AccessTokenBO createToken(OAuth2CreateTokenDTO oauth2CreateTokenDTO);
|
||||
|
||||
/**
|
||||
* 基于用户移除 accessToken
|
||||
*
|
||||
@@ -27,20 +14,4 @@ public interface OAuth2Service {
|
||||
*/
|
||||
void removeToken(OAuth2RemoveTokenByUserDTO oauth2RemoveTokenDTO);
|
||||
|
||||
/**
|
||||
* 刷新令牌,获得新的 accessToken 信息
|
||||
*
|
||||
* @param oauth2RefreshTokenDTO refreshToken 信息
|
||||
* @return accessToken 信息
|
||||
*/
|
||||
OAuth2AccessTokenBO refreshToken(OAuth2RefreshTokenDTO oauth2RefreshTokenDTO);
|
||||
|
||||
/**
|
||||
* 通过 accessToken 获得身份信息
|
||||
*
|
||||
* @param oauth2GetTokenDTO accessToken 信息
|
||||
* @return 身份信息
|
||||
*/
|
||||
OAuth2AuthenticationBO getAuthentication(OAuth2GetTokenDTO oauth2GetTokenDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
package cn.iocoder.mall.system.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.api.bo.role.RoleBO;
|
||||
import cn.iocoder.mall.system.api.dto.role.RoleAddDTO;
|
||||
import cn.iocoder.mall.system.api.dto.role.RoleAssignResourceDTO;
|
||||
import cn.iocoder.mall.system.api.dto.role.RolePageDTO;
|
||||
import cn.iocoder.mall.system.api.dto.role.RoleUpdateDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface RoleService {
|
||||
|
||||
PageResult<RoleBO> getRolePage(RolePageDTO rolePageDTO);
|
||||
|
||||
/**
|
||||
* @return 返回角色列表
|
||||
*/
|
||||
List<RoleBO> getRoleList();
|
||||
|
||||
Boolean assignRoleResource(Integer adminId, RoleAssignResourceDTO roleAssignResourceDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package cn.iocoder.mall.system.api.dto.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@ApiModel("管理员认证 DTO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminAuthenticationDTO {
|
||||
|
||||
@ApiModelProperty(value = "登陆账号", required = true, example = "15601691300")
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 5, max = 16, message = "账号长度为 5-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "buzhidao")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user