完成资源模块的改造
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源 Rpc 接口
|
||||
*/
|
||||
public interface ResourceRpc {
|
||||
|
||||
/**
|
||||
* 创建资源
|
||||
*
|
||||
* @param createDTO 创建资源 DTO
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<Integer> createResource(ResourceCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新资源
|
||||
*
|
||||
* @param updateDTO 更新资源 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateResource(ResourceUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<ResourceVO> getResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源列表
|
||||
*
|
||||
* @param resourceIds 资源编号列表
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listResource(List<Integer> resourceIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.systemservice.enums.permission.ResourceTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 资源创建 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceCreateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 菜单名
|
||||
*/
|
||||
@NotEmpty(message = "菜单名不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotNull(message = "资源类型不能为空")
|
||||
@InEnum(value = ResourceTypeEnum.class, message = "资源类型必须是 {value}")
|
||||
private Integer type;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父级资源编号
|
||||
*/
|
||||
@NotNull(message = "父级资源编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 前端路由
|
||||
*/
|
||||
private String route;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 创建管理员编号
|
||||
*/
|
||||
@NotNull(message = "创建管理员编号不能为空")
|
||||
private Integer createAdminId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.systemservice.enums.permission.ResourceTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 资源更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceUpdateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 资源编号
|
||||
*/
|
||||
@NotNull(message = "资源编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 菜单名
|
||||
*/
|
||||
@NotEmpty(message = "菜单名不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotNull(message = "资源类型不能为空")
|
||||
@InEnum(value = ResourceTypeEnum.class, message = "资源类型必须是 {value}")
|
||||
private Integer type;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父级资源编号
|
||||
*/
|
||||
@NotNull(message = "父级资源编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 前端路由
|
||||
*/
|
||||
private String route;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 资源 VO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ResourceVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 资源编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 菜单名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父级资源编号
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 前端路由
|
||||
*/
|
||||
private String route;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user