- admin 模块重命名 system 模块
This commit is contained in:
41
system/system-service-api/pom.xml
Normal file
41
system/system-service-api/pom.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>system</artifactId>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>system-service-api</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.dto.AdminAccessLogAddDTO;
|
||||
|
||||
/**
|
||||
* 管理员访问日志 Service 接口
|
||||
*/
|
||||
public interface AdminAccessLogService {
|
||||
|
||||
CommonResult<Boolean> addAdminAccessLog(AdminAccessLogAddDTO adminAccessLogAddDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.constant.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.bo.AdminBO;
|
||||
import cn.iocoder.mall.admin.api.bo.AdminPageBO;
|
||||
import cn.iocoder.mall.admin.api.dto.AdminAddDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.AdminUpdateDTO;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 管理员 Service 接口
|
||||
*/
|
||||
public interface AdminService {
|
||||
|
||||
CommonResult<AdminPageBO> getAdminPage(AdminPageDTO adminPageDTO);
|
||||
|
||||
CommonResult<AdminBO> addAdmin(Integer adminId, AdminAddDTO adminAddDTO);
|
||||
|
||||
CommonResult<Boolean> updateAdmin(Integer adminId, AdminUpdateDTO adminUpdateDTO);
|
||||
|
||||
CommonResult<Boolean> updateAdminStatus(Integer adminId, Integer updateAdminId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
|
||||
|
||||
CommonResult<Boolean> deleteAdmin(Integer adminId, Integer updateAdminId);
|
||||
|
||||
CommonResult<Boolean> assignRole(Integer adminId, Integer updateAdminId, Set<Integer> roleIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.bo.DataDictBO;
|
||||
import cn.iocoder.mall.admin.api.dto.DataDictAddDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.DataDictUpdateDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface DataDictService {
|
||||
|
||||
CommonResult<List<DataDictBO>> selectDataDictList();
|
||||
|
||||
CommonResult<DataDictBO> addDataDict(Integer adminId, DataDictAddDTO dataDictAddDTO);
|
||||
|
||||
CommonResult<Boolean> updateDataDict(Integer adminId, DataDictUpdateDTO dataDictUpdateDTO);
|
||||
|
||||
CommonResult<Boolean> deleteDataDict(Integer adminId, Integer dataDictId);
|
||||
|
||||
/**
|
||||
* 获取字典值 - 单个
|
||||
*
|
||||
* 注意: dictValue:Object 为了方便调用,会自动转换为 dictValue:String
|
||||
*
|
||||
* @param dictKey
|
||||
* @param dictValue
|
||||
* @return
|
||||
*/
|
||||
CommonResult<DataDictBO> getDataDict(String dictKey, Object dictValue);
|
||||
CommonResult<List<DataDictBO>> getDataDict(String dictKey);
|
||||
|
||||
/**
|
||||
* 获取字典值 - 多个
|
||||
*
|
||||
* 注意:dictValueList:? 为了方便调用,会自动转换为 Set:String
|
||||
*
|
||||
* @param dictKey
|
||||
* @param dictValueList
|
||||
* @return
|
||||
*/
|
||||
CommonResult<List<DataDictBO>> getDataDictList(String dictKey, Collection<?> dictValueList);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.bo.OAuth2AccessTokenBO;
|
||||
import cn.iocoder.mall.admin.api.bo.OAuth2AuthenticationBO;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface OAuth2Service {
|
||||
|
||||
CommonResult<OAuth2AccessTokenBO> getAccessToken(String username, String password);
|
||||
|
||||
/**
|
||||
* 校验访问令牌,获取身份信息( 不包括 accessToken 等等 )
|
||||
*
|
||||
* @param accessToken 访问令牌
|
||||
* @return 授权信息
|
||||
*/
|
||||
CommonResult<OAuth2AuthenticationBO> checkToken(String accessToken);
|
||||
|
||||
/**
|
||||
* 校验权限(鉴权)
|
||||
*
|
||||
* @param adminId 管理员编号
|
||||
* @param roleIds 管理员拥有的角色编号的集合
|
||||
* @param url 指定 URL
|
||||
* @return 是否有权限
|
||||
*/
|
||||
CommonResult<Boolean> checkPermission(Integer adminId, Set<Integer> roleIds, String url);
|
||||
|
||||
// TODO @see 刷新 token
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.bo.ResourceBO;
|
||||
import cn.iocoder.mall.admin.api.dto.ResourceAddDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.ResourceUpdateDTO;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ResourceService {
|
||||
|
||||
/**
|
||||
* 查询指定类型 + 指定角色的资源列表
|
||||
*
|
||||
* @param type 指定类型。可以为空,此时不作为过滤条件
|
||||
* @param roleIds 指定角色的数组。
|
||||
* @return 资源列表
|
||||
*/
|
||||
List<ResourceBO> getResourcesByTypeAndRoleIds(@Nullable Integer type, Set<Integer> roleIds);
|
||||
|
||||
/**
|
||||
* 查询指定类型的资源列表
|
||||
*
|
||||
* @param type 指定类型。可以为空,此时不做为过滤条件
|
||||
* @return 资源列表
|
||||
*/
|
||||
List<ResourceBO> getResourcesByType(@Nullable Integer type);
|
||||
|
||||
CommonResult<ResourceBO> addResource(Integer adminId, ResourceAddDTO resourceAddDTO);
|
||||
|
||||
CommonResult<Boolean> updateResource(Integer adminId, ResourceUpdateDTO resourceUpdateDTO);
|
||||
|
||||
CommonResult<Boolean> deleteResource(Integer adminId, Integer resourceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.admin.api.bo.RoleBO;
|
||||
import cn.iocoder.mall.admin.api.bo.RolePageBO;
|
||||
import cn.iocoder.mall.admin.api.dto.RoleAddDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.RoleUpdateDTO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface RoleService {
|
||||
|
||||
CommonResult<RolePageBO> getRolePage(RolePageDTO rolePageDTO);
|
||||
|
||||
/**
|
||||
* 获得指定管理员拥有的角色编号数组
|
||||
*
|
||||
* @param adminId 指定管理员
|
||||
* @return 角色编号数组
|
||||
*/
|
||||
CommonResult<Set<Integer>> getRoleList(Integer adminId);
|
||||
|
||||
/**
|
||||
* @return 返回角色列表
|
||||
*/
|
||||
CommonResult<List<RoleBO>> getRoleList();
|
||||
|
||||
CommonResult<RoleBO> addRole(Integer adminId, RoleAddDTO roleAddDTO);
|
||||
|
||||
CommonResult<Boolean> updateRole(Integer adminId, RoleUpdateDTO roleUpdateDTO);
|
||||
|
||||
CommonResult<Boolean> deleteRole(Integer adminId, Integer roleId);
|
||||
|
||||
CommonResult<Boolean> assignResource(Integer adminId, Integer roleId, Set<Integer> resourceIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 管理员 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 管理员编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 登陆账号
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 账号状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 管理员分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 管理员数组
|
||||
*/
|
||||
private List<AdminBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据字典 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DataDictBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 大类枚举值
|
||||
*/
|
||||
private String enumValue;
|
||||
/**
|
||||
* 小类数值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
private String displayName;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* OAUTH2 AccessToken BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2AccessTokenBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 访问令牌
|
||||
*/
|
||||
private String accessToken;
|
||||
/**
|
||||
* 刷新令牌
|
||||
*/
|
||||
private String refreshToken;
|
||||
/**
|
||||
* 过期时间,单位:秒。
|
||||
*/
|
||||
private Integer expiresIn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* OAUTH2 认证 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2AuthenticationBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 管理员编号
|
||||
*/
|
||||
private Integer adminId;
|
||||
/**
|
||||
* 角色编号数组
|
||||
*/
|
||||
private Set<Integer> roleIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 资源 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 资源编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 资源名字(标识)
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
private String displayName;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 父级资源编号
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RoleBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 角色名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.admin.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RolePageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色数组
|
||||
*/
|
||||
private List<RoleBO> roles;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package cn.iocoder.mall.admin.api.constant;
|
||||
|
||||
public class AdminConstants {
|
||||
|
||||
public static final String USERNAME_ADMIN = "admin";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.mall.admin.api.constant;
|
||||
|
||||
/**
|
||||
* 错误码枚举类
|
||||
*
|
||||
* 管理员系统,使用 1-002-000-000 段
|
||||
*/
|
||||
public enum AdminErrorCodeEnum {
|
||||
|
||||
// ========== OAUTH2 模块 ==========
|
||||
OAUTH2_UNKNOWN(1002001000, "未知错误"), // 预留
|
||||
// OAUTH2_INVALID_GRANT_BAD_CREDENTIALS(1001001001, "密码不正确"), // 暂时没用到
|
||||
// OAUTH2_INVALID_GRANT_USERNAME_NOT_FOUND(1001001002, "账号不存在"), // 暂时没用到
|
||||
// OAUTH2_INVALID_GRANT(1001001010, ""), // 预留
|
||||
OAUTH_INVALID_TOKEN_NOT_FOUND(1002001011, "访问令牌不存在"),
|
||||
OAUTH_INVALID_TOKEN_EXPIRED(1002001012, "访问令牌已过期"),
|
||||
OAUTH_INVALID_TOKEN_INVALID(1002001013, "访问令牌已失效"),
|
||||
OAUTH_INVALID_PERMISSION(1002001014, "没有该操作权限"), // TODO 芋艿,临时放在 OAUTH2 模块,理论来说,OAUTH2 只做认证,不做鉴权。
|
||||
OAUTH_NOT_LOGIN(1002001015, "账号未登陆"),
|
||||
|
||||
OAUTH_INVALID_TOKEN(1002001020, ""), // 预留
|
||||
|
||||
// ========== 管理员模块 1002002000 ==========
|
||||
ADMIN_USERNAME_NOT_REGISTERED(1002002000, "账号不存在"),
|
||||
ADMIN_PASSWORD_ERROR(1002002001, "密码不正确"),
|
||||
ADMIN_IS_DISABLE(1002002002, "账号被禁用"),
|
||||
ADMIN_USERNAME_EXISTS(1002002002, "账号已经存在"),
|
||||
ADMIN_STATUS_EQUALS(1002002003, "账号已经是该状态"),
|
||||
ADMIN_DELETE_ONLY_DISABLE(1002002004, "只有关闭的账号才可以删除"),
|
||||
ADMIN_ADMIN_STATUS_CAN_NOT_UPDATE(1002002005, "管理员的账号状态不允许变更"),
|
||||
|
||||
// ========== 资源模块 1002003000 ==========
|
||||
RESOURCE_NAME_DUPLICATE(1002003000, "已经存在该名字的资源"),
|
||||
RESOURCE_PARENT_NOT_EXISTS(1002003001, "父资源不存在"),
|
||||
RESOURCE_PARENT_ERROR(1002003002, "不能设置自己为父资源"),
|
||||
RESOURCE_NOT_EXISTS(1002003003, "资源不存在"),
|
||||
RESOURCE_EXISTS_CHILDREN(1002003004, "存在子资源,无法删除"),
|
||||
|
||||
// ========== 角色模块 1002004000 ==========
|
||||
ROLE_NOT_EXISTS(1002004000, "角色不存在"),
|
||||
ROLE_ASSIGN_RESOURCE_NOT_EXISTS(1002004001, "分配角色资源时,有资源不存在"),
|
||||
|
||||
// ========== 数据字典模块 1002005000 ==========
|
||||
DATA_DICT_EXISTS(1002005000, "该数据字典已经存在"),
|
||||
DATA_DICT_NOT_EXISTS(1002005001, "该数据字典不存在"),
|
||||
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
AdminErrorCodeEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.mall.admin.api.constant;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
public interface ResourceConstants {
|
||||
|
||||
/**
|
||||
* 类型 - 菜单
|
||||
*/
|
||||
Integer TYPE_MENU = 1;
|
||||
/**
|
||||
* 类型 - URL
|
||||
*/
|
||||
Integer TYPE_URL = 2;
|
||||
|
||||
/**
|
||||
* 父资源编号 - 根节点
|
||||
*/
|
||||
Integer PID_ROOT = 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 管理员访问日志添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminAccessLogAddDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 管理员编号 - 空
|
||||
*/
|
||||
public static final Integer ADMIN_ID_NULL = 0;
|
||||
|
||||
/**
|
||||
* 管理员编号.
|
||||
*
|
||||
* 当管理员为空时,该值为0
|
||||
*/
|
||||
@NotNull(message = "管理员编号不能为空")
|
||||
private Integer adminId;
|
||||
/**
|
||||
* 访问地址
|
||||
*/
|
||||
@NotNull(message = "访问地址不能为空")
|
||||
private String uri;
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
@NotNull(message = "请求参数不能为空")
|
||||
private String queryString;
|
||||
/**
|
||||
* http 方法
|
||||
*/
|
||||
@NotNull(message = "http 请求方法不能为空")
|
||||
private String method;
|
||||
/**
|
||||
* User Agent
|
||||
*/
|
||||
@NotNull(message = "User-Agent 不能为空")
|
||||
private String userAgent;
|
||||
/**
|
||||
* ip
|
||||
*/
|
||||
@NotNull(message = "ip 不能为空")
|
||||
private String ip;
|
||||
/**
|
||||
* 请求时间
|
||||
*/
|
||||
@NotNull(message = "请求时间不能为空")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 响应时长 -- 毫秒级
|
||||
*/
|
||||
@NotNull(message = "响应时长不能为空")
|
||||
private Integer responseTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 管理员添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminAddDTO {
|
||||
|
||||
/**
|
||||
* 登陆账号
|
||||
*/
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 6, max = 16, message = "账号长度为 6-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotEmpty(message = "昵称不能为空")
|
||||
@Length(max = 10, message = "昵称长度最大为 10 位")
|
||||
private String nickname;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 6, max = 16, message = "密码长度为 6-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 管理员分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminPageDTO {
|
||||
|
||||
/**
|
||||
* 昵称,模糊匹配
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 管理员更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminUpdateDTO {
|
||||
|
||||
/**
|
||||
* 管理员编号
|
||||
*/
|
||||
@NotNull(message = "管理员编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 登陆账号
|
||||
*/
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 6, max = 16, message = "账号长度为 6-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotEmpty(message = "昵称不能为空")
|
||||
@Length(max = 10, message = "昵称长度最大为 10 位")
|
||||
private String nickname;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Length(min = 6, max = 16, message = "密码长度为 6-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 数据字典添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DataDictAddDTO {
|
||||
|
||||
/**
|
||||
* 大类枚举值
|
||||
*/
|
||||
@NotEmpty(message = "大类枚举值不能为空")
|
||||
private String enumValue;
|
||||
/**
|
||||
* 小类数值
|
||||
*/
|
||||
@NotEmpty(message = "小类数值不能为空")
|
||||
private String value;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
@NotEmpty(message = "展示名不能为空")
|
||||
private String displayName;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 数据字典更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DataDictUpdateDTO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 小类数值
|
||||
*/
|
||||
@NotEmpty(message = "小类数值不能为空")
|
||||
private String value;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
@NotEmpty(message = "展示名不能为空")
|
||||
private String displayName;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 资源添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceAddDTO {
|
||||
|
||||
/**
|
||||
* 资源名字(标识)
|
||||
*/
|
||||
@NotEmpty(message = "资源名字不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer type;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
@NotEmpty(message = "资源名字不能为空")
|
||||
private String displayName;
|
||||
/**
|
||||
* 父资源编号
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 资源更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceUpdateDTO {
|
||||
|
||||
/**
|
||||
* 资源编号
|
||||
*/
|
||||
@NotNull(message = "资源编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 资源名字(标识)
|
||||
*/
|
||||
@NotEmpty(message = "资源名字不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 展示名
|
||||
*/
|
||||
@NotEmpty(message = "资源名字不能为空")
|
||||
private String displayName;
|
||||
/**
|
||||
* 父资源编号
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 角色添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RoleAddDTO {
|
||||
|
||||
/**
|
||||
* 角色名字(标识)
|
||||
*/
|
||||
@NotEmpty(message = "角色名字不能为空")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 角色分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RolePageDTO {
|
||||
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
private String name;
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public RolePageDTO setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public RolePageDTO setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public RolePageDTO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 角色添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RoleUpdateDTO {
|
||||
|
||||
/**
|
||||
* 角色编号
|
||||
*/
|
||||
@NotNull(message = "角色编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 角色名字(标识)
|
||||
*/
|
||||
@NotEmpty(message = "角色名字不能为空")
|
||||
private String name;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user