feature(权限点):新增CRUD

This commit is contained in:
zhansihu 2023-09-06 11:36:43 +08:00
parent b13411f625
commit 5db09f1883
10 changed files with 480 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# 项目介绍
提尔Týr是北欧神话中的战争与勇气之神同时也是契约的保证人誓言的守护者和荣耀的代表。阿萨神族主神奥丁之子。
权限服务

View File

@ -0,0 +1,36 @@
package cn.axzo.tyr.client.model.enums;
import lombok.AllArgsConstructor;
import java.util.HashMap;
import java.util.Map;
/**
* 权限点授权策略类型
*
* @version V1.0
* @author: ZhanSiHu
* @date: 2023/9/6 11:05
*/
@AllArgsConstructor
public enum DelegatedType {
PLAT(1, "平台授权型"),
CUSTOM(2, "客户授权型"),
NO_NEED(3, "免授权型"),
;
private Integer code;
private String desc;
private static final Map<Integer, DelegatedType> MAPPING = new HashMap<>();
static {
for (DelegatedType type : DelegatedType.values()) {
MAPPING.put(type.code, type);
}
}
public DelegatedType apply(Integer code) {
return code == null ? null :MAPPING.get(code);
}
}

View File

@ -0,0 +1,143 @@
package cn.axzo.tyr.client.model.permission;
import java.time.LocalDateTime;
/**
* 权限点对象
*
* @version V1.0
* @author: ZhanSiHu
* @date: 2023/9/5 15:50
*/
public class PermissionPointDTO {
/**
* 权限点id
*/
private Long id;
/**
* 权限点名称
*/
private String featureName;
/**
* 元素code
*/
private String featureCode;
/**
* 菜单icon
*/
private String icon;
/**
* 上级权限点id
*/
private Long parentId;
/**
* 页面路由
*/
private String linkUrl;
/**
* 适用终端 1:PC 2:UNI 4:APP
*/
private Integer linkType;
/**
* 扩展字段 - APP适配参数
*/
private String linkExt;
/**
* 小程序AppID
*/
private String microAppItemId;
/**
* 权限点层级path
*/
private String path;
/**
* 排序
*/
private Integer sort;
/**
* 菜单适用于平台 0:企业工作台 1:项目工作台
*/
private String terminal;
/**
* 元素类别 0.模块 1.菜单 2页面 3按钮
*/
private Integer featureType;
/**
* 创建人id
*/
private Long createBy;
/**
* 创建时间
*/
private LocalDateTime createAt;
/**
* 更新时间
*/
private LocalDateTime updateAt;
/**
* 修改人id
*/
private Long updateBy;
/**
* 0:查看 1:操作
*/
private Integer operateType;
/**
* 适用单位类型-65535:所有 1:总包 2:建设单位 4:监理单位 8:劳务分包 16:专业分包
*/
private Long fitOuTypeBit;
/**
* 适用节点类型 65535:所有 1:部门 2:班组 4:小组
*/
private Long fitOuNodeTypeBit;
/**
* 所属应用
*/
private String appName;
/**
* 功能URL
*/
private String featureUrl;
/**
* 是否认证 0:无需要认证 1:需要认证
*/
private Boolean needCert;
/**
* 是否授权 0:无需要授权 1:需要授权
*/
private Boolean needAuth;
/**
* 授权策略类型允许为空 1-平台授权型 2-客户授权型 3-免授权型
*/
private Integer delegatedType;
}

View File

@ -0,0 +1,27 @@
package cn.axzo.tyr.client.model.permission;
import java.util.List;
/**
* 权限点树形节点
*
* @version V1.0
* @author: ZhanSiHu
* @date: 2023/9/5 15:20
*/
public class PermissionPointTreeNode {
/** 权限点ID **/
private Long permissionPointId;
/** 父级节点ID **/
private Long parentId;
/** 权限点名称 **/
private String permissionName;
/** 所属端 **/
private String terminal;
/** 下级节点 **/
private List<PermissionPointTreeNode> children;
}

View File

@ -0,0 +1,23 @@
package cn.axzo.tyr.client.model.permission;
import lombok.Data;
/**
* 权限点树形查询请求参数
*
* @version V1.0
* @author: ZhanSiHu
* @date: 2023/9/5 15:12
*/
@Data
public class PermissionPointTreeQueryReq {
/** 授权策略 1-平台授权型 2-客户授权型 免授权型, 为空查全部**/
private Integer delegateType;
/** 搜索关键字 - 名称模糊搜索 **/
private String keyword;
/** 权限点父级ID - 用于查询子节点 **/
private Long parentId;
}

View File

@ -13,6 +13,12 @@
<name>tyr-server</name>
<properties>
<!--不打包发布server模块-->
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.framework</groupId>

View File

@ -0,0 +1,191 @@
package cn.axzo.tyr.server.repository.entity;
import cn.axzo.framework.data.mybatisplus.model.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author ZhanSiHu
* @since 2023-09-06
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("saas_feature")
public class SaasFeature extends BaseEntity<SaasFeature> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 名称
*/
private String featureName;
/**
* code
*/
private String featureCode;
/**
* 图标地址
*/
private String icon;
/**
* 菜单上级id
*/
private Long parentId;
/**
* 产品板块Id
*/
private Long parentModuleId;
/**
* 链接地址
*/
private String linkUrl;
/**
* 1:CMS 2:小程序 4:原生
*/
private Integer linkType;
/**
* 扩展字段
*/
private String linkExt;
/**
* 小程序id 关联micro_app_item id
*/
private String microAppItemId;
/**
* 路径
*/
private String path;
/**
* 描述
*/
private String description;
/**
* 排序
*/
private Integer sort;
/**
* 菜单适用于平台 0:企业工作台 1:项目工作台
*/
private String terminal;
/**
* 类型 0.模块 1.菜单 2页面 3功能
*/
private Integer featureType;
/**
* 是否删除
*/
private Long isDelete;
/**
* 创建人id
*/
private Long createBy;
/**
* 创建时间
*/
private LocalDateTime createAt;
/**
* 更新时间
*/
private LocalDateTime updateAt;
/**
* 修改人id
*/
private Long updateBy;
private String legacyLayout;
/**
* 0:查看 1:操作
*/
private Integer operateType;
/**
* 为了迁移菜单用的迁移后将废弃
*/
private Long oldId;
/**
* 适用单位类型-65535:所有 1:总包 2:建设单位 4:监理单位 8:劳务分包 16:专业分包
*/
private Long fitOuTypeBit;
/**
* 适用节点类型65535:所有 1:部门 2:班组 4:小组
*/
private Long fitOuNodeTypeBit;
/**
* 网关专属字段所属应用
*/
private String appName;
/**
* 网关专属字段 功能URL对应后端接口url
*/
private String featureUrl;
/**
* 网关专属字段是否认证 0:无需要认证 1:需要认证
*/
private Boolean needCert;
/**
* 网关专属字段是否授权 0:无需要授权 1:需要授权
*/
private Boolean needAuth;
/**
* 业务id用于环境同步作为唯一键
*/
private String businessNo;
/**
* 父级业务id
*/
private String parentBusinessNo;
/**
* 授权策略类型允许为空 1-平台授权型 2-客户授权型 3-免授权型
*/
private Integer delegatedType;
}

View File

@ -0,0 +1,16 @@
package cn.axzo.tyr.server.repository.mapper;
import cn.axzo.tyr.server.repository.entity.SaasFeature;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ZhanSiHu
* @since 2023-09-06
*/
public interface SaasFeatureMapper extends BaseMapper<SaasFeature> {
}

View File

@ -0,0 +1,16 @@
package cn.axzo.tyr.server.repository.service;
import cn.axzo.tyr.server.repository.entity.SaasFeature;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author ZhanSiHu
* @since 2023-09-06
*/
public interface SaasFeatureDao extends IService<SaasFeature> {
}

View File

@ -0,0 +1,20 @@
package cn.axzo.tyr.server.repository.service.impl;
import cn.axzo.tyr.server.repository.entity.SaasFeature;
import cn.axzo.tyr.server.repository.mapper.SaasFeatureMapper;
import cn.axzo.tyr.server.repository.service.SaasFeatureDao;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author ZhanSiHu
* @since 2023-09-06
*/
@Service
public class SaasFeatureDaoImpl extends ServiceImpl<SaasFeatureMapper, SaasFeature> implements SaasFeatureDao {
}