init
This commit is contained in:
50
.dockerignore
Normal file
50
.dockerignore
Normal file
@@ -0,0 +1,50 @@
|
||||
### Java template
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven template
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Example user template template
|
||||
### Example user template
|
||||
|
||||
# IntelliJ project files
|
||||
.idea
|
||||
*.iml
|
||||
out
|
||||
gen
|
||||
|
||||
|
||||
!$DRONE_COMMIT_BRANCH.jar
|
||||
!start.sh
|
||||
105
.drone.yml
Normal file
105
.drone.yml
Normal file
@@ -0,0 +1,105 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: fateverse
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
|
||||
steps:
|
||||
- name: build-jar # 流水线名称
|
||||
image: maven:3.8.5-openjdk-11 # 定义创建容器的Docker镜像,maven:3.8.5-openjdk-8用于对java进行打包使用
|
||||
volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置
|
||||
- name: maven-cache
|
||||
path: /root/.m2 # 将maven下载依赖的目录挂载出来,防止重复下载
|
||||
- name: maven-build
|
||||
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
- sed -i 's/$DRONE_COMMIT_BRANCH/'"$DRONE_COMMIT_BRANCH"'/' start.sh
|
||||
- bash maven.sh
|
||||
|
||||
- name: build-docker # 制作docker镜像
|
||||
image: docker # 使用官方docker镜像
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: maven-build
|
||||
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
|
||||
- name: docker
|
||||
path: /var/run/docker.sock # 挂载宿主机的docker
|
||||
# - name: skywalking
|
||||
# path: /app/skywalking
|
||||
environment: # 获取到密文的docker用户名和密码
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
REGISTRY:
|
||||
from_secret: registry
|
||||
REGISTRY_NAMESPACE:
|
||||
from_secret: registry_namespace
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
- cd /app/build/$DRONE_COMMIT_BRANCH
|
||||
- sed -i 's/$REGISTRY/'"$REGISTRY"'/' deployment.yml
|
||||
- sed -i 's/$REGISTRY_NAMESPACE/'"$REGISTRY_NAMESPACE"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_COMMIT_BRANCH/'"$DRONE_COMMIT_BRANCH"'/' start.sh
|
||||
- sed -i 's/$DRONE_COMMIT_BRANCH/'"$DRONE_COMMIT_BRANCH"'/' Dockerfile
|
||||
- sed -i 's/$DRONE_COMMIT_BRANCH/'"$DRONE_COMMIT_BRANCH"'/' .dockerignore
|
||||
- sed -i 's/$DRONE_COMMIT_BRANCH/'"$DRONE_COMMIT_BRANCH"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_COMMIT/'"$DRONE_COMMIT"'/' deployment.yml
|
||||
# docker登录,不能在脚本中登录,并且不能使用docker login -u -p
|
||||
- echo $DOCKER_PASSWORD | docker login $REGISTRY --username $DOCKER_USERNAME --password-stdin
|
||||
- chmod +x docker.sh
|
||||
# - cp -r /app/skywalking ./
|
||||
- sh docker.sh
|
||||
# 执行完脚本删除本次制作的docker镜像,避免多次后当前runner空间不足
|
||||
- docker rmi -f $(docker images | grep $DRONE_COMMIT_BRANCH | awk '{print $3}')
|
||||
|
||||
|
||||
- name: deploy # rancher运行
|
||||
image: bitnami/kubectl:1.26.13-debian-11-r1 #阿里云的kubectl镜像,里面包含kubectl命令行工具
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: maven-build
|
||||
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
|
||||
- name: config
|
||||
path: /app/config # 将kubectl 配置文件挂载出来
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
- cd /app/build/$DRONE_COMMIT_BRANCH
|
||||
# 通过kubectl指令运行deployment.yml,并指定授权文件kubectl_conf.yml
|
||||
- kubectl apply -f deployment.yml -n fateverse --kubeconfig=/app/config/base-taishan-kubectl.yml
|
||||
|
||||
|
||||
|
||||
volumes:
|
||||
- name: maven-build
|
||||
host:
|
||||
path: /home/build/fateverse
|
||||
- name: skywalking
|
||||
host:
|
||||
path: /home/skywalking-agent
|
||||
- name: config # k8s对接的配置文件
|
||||
host:
|
||||
path: /home/kubect
|
||||
- name: maven-cache
|
||||
host:
|
||||
path: /home/data/maven/cache
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
# 定义触发条件
|
||||
trigger:
|
||||
branch:
|
||||
- gateway
|
||||
- auth
|
||||
- admin-biz
|
||||
- notice-biz
|
||||
- log-biz
|
||||
- monitor
|
||||
- code-gen
|
||||
- custom-query
|
||||
- sentinel-dashboard
|
||||
- sentinel-dashboard-pro
|
||||
- code-gen-test-mysql
|
||||
- workflow
|
||||
- flowable
|
||||
|
||||
event:
|
||||
- push
|
||||
36
.gitignore
vendored
Normal file
36
.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
**/target/
|
||||
#**/resources/bootstrap.yml
|
||||
#common/common-log/pom.xml
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM openjdk:11.0.10-jre
|
||||
VOLUME /tmp
|
||||
RUN useradd -b /home -m -s /bin/bash clay
|
||||
RUN chmod a+xr -R /home/clay && chown clay:clay -R /home/clay
|
||||
#COPY skywalking /home/clay/skywalking-agent
|
||||
#RUN chmod a+xr -R /home/clay/skywalking-agent && chown clay:clay -R /home/clay/skywalking-agent
|
||||
USER clay
|
||||
ARG NAME=$DRONE_COMMIT_BRANCH
|
||||
COPY ./$NAME.jar /home/clay/$NAME.jar
|
||||
COPY start.sh /home/clay/start.sh
|
||||
WORKDIR /home/clay
|
||||
RUN mkdir -p /home/clay/logs && touch /home/clay/logs/spring.log
|
||||
#RUN mkdir -p /home/clay/code
|
||||
#RUN chmod 777 /home/clay/code
|
||||
#RUN mkdir -p /home/clay/skywalking-agent/logs && touch /home/clay/skywalking-agent/logs/skywalking-api.log
|
||||
ENV REF_NAME dev
|
||||
EXPOSE 8080
|
||||
CMD bash /home/clay/start.sh $REF_NAME && echo "start logging..." && : > /home/clay/logs/spring.log && tail -F -n 500 /home/clay/logs/spring.log
|
||||
70
README.md
Normal file
70
README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# 系统说明
|
||||
|
||||
- 基于 Spring Cloud 2021 、Spring Boot 2.7、 Spring Security 的权限管理系统
|
||||
- 采用前后端分离的模式,前端(基于 FateVerse-React, FateVerse-Vue)
|
||||
- 注册中心,配置中心使用Nacos,权限认证使用Spring Security + Redis
|
||||
- 流量控制使用Sentinel,分布式事务选用Seata
|
||||
- gitea+drone+harbor+rancher全套部署流程
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 核心依赖
|
||||
|
||||
| 依赖 | 版本 |
|
||||
|----------------------|------------|
|
||||
| Spring Boot | 2.7.5 |
|
||||
| Spring Cloud | 2021.0.5 |
|
||||
| Spring Cloud Alibaba | 2021.0.4.0 |
|
||||
| Mybatis | 3.5.2 |
|
||||
| Vue | 3.1.3 |
|
||||
| React | 3.1.3 |
|
||||
|
||||
### 模块说明
|
||||
|
||||
```lua
|
||||
FateVerse
|
||||
├── auth -- 授权服务提供
|
||||
└── common -- 系统公共模块
|
||||
├── common-code -- 代码引擎的基础封装
|
||||
├── common-core -- 公共工具类核心包
|
||||
├── common-decrypt -- 加密模块
|
||||
├── common-dubbo -- dubbo rpc服务
|
||||
├── common-email -- 邮件发送服务
|
||||
├── common-excel -- excel导出模块
|
||||
├── common-file -- 分布式文件存储
|
||||
├── common-lock -- 分布式锁模块
|
||||
├── common-mybatis -- mybatis 扩展封装
|
||||
├── common-mybatis-puls -- mybatis-puls 扩展封装
|
||||
├── common-redis -- redis序列化封装
|
||||
├── common-seata -- seata模块
|
||||
├── common-security -- 系统权限控制模块
|
||||
├── common-swagger -- swagger接口文档
|
||||
└── common-log -- 系统日志记录
|
||||
└── notice -- 通用消息公告模块
|
||||
├── notice-api -- 通用消息公告模块公共api模块
|
||||
└── notice-biz -- 通用消息公告模块业务处理模块[5000]
|
||||
└── admin -- 通用用户权限管理模块
|
||||
├── admin-api -- 通用用户权限管理系统公共api模块
|
||||
└── admin-biz -- 通用用户权限管理系统业务处理模块[4000]
|
||||
├── sql -- 数据库文件
|
||||
└── visual -- 图形化管理模块
|
||||
├── code-gen -- 代码生成模块
|
||||
├── monitor -- 服务监控
|
||||
└── sentinel-dashboard -- sentinel 官方版
|
||||
└── nacos_config.zip -- nacos基础配置
|
||||
```
|
||||
|
||||
### 本地开发 运行
|
||||
|
||||
### 对象存储
|
||||
|
||||
在 SpringBoot **FTP**、**minio**、**FastDFS**、**阿里云OSS**
|
||||
|
||||
### 系统架构图
|
||||
|
||||

|
||||
|
||||
### 压力测试
|
||||
|
||||
- 4*8 单节点测试结果
|
||||

|
||||
34
admin/admin-api/pom.xml
Normal file
34
admin/admin-api/pom.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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>admin</artifactId>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>admin-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-dubbo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-decrypt</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import cn.fateverse.admin.entity.Config;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 参数配置表对象 sys_config
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("参数配置表Dto")
|
||||
public class ConfigDto {
|
||||
|
||||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
@ApiModelProperty("参数主键")
|
||||
private Integer configId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@NotNull(message = "参数名称不能为空!")
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@NotNull(message = "参数键名不能为空!")
|
||||
@ApiModelProperty("参数键名")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
@NotNull(message = "参数键值不能为空!")
|
||||
@ApiModelProperty("参数键值")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 系统内置(1是 0否)
|
||||
*/
|
||||
@NotNull(message = "是否系统内置不能为空!")
|
||||
@ApiModelProperty("系统内置(1是 0否)")
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
public Config toConfig() {
|
||||
Config build = Config.builder()
|
||||
.configId(configId)
|
||||
.configName(configName)
|
||||
.configKey(configKey)
|
||||
.configValue(configValue)
|
||||
.configType(configType)
|
||||
.build();
|
||||
build.setRemark(remark);
|
||||
return build;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Data
|
||||
public class DeptDto {
|
||||
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空!")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@NotNull(message = "显示顺序不能为空!")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@NotBlank(message = "负责人不能为空!")
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
@NotNull(message = "负责人id不能为空!")
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Pattern(message = "手机号格式错误!",regexp = "^1[0-9]{10}$")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Email(message = "邮箱格式错误!")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:1正常,0停用
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023/5/18
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("字典数据实体")
|
||||
public class DictDataDto {
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private Long dictCode;
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
@ApiModelProperty("字典排序")
|
||||
@NotNull(message = "状态不能为空!")
|
||||
private Integer dictSort;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@ApiModelProperty("字典标签")
|
||||
@NotNull(message = "字典标签不能为空!")
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
@ApiModelProperty("字典键值")
|
||||
@NotNull(message = "字典键值不能为空!")
|
||||
private String dictValue;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
@NotNull(message = "字典类型不能为空!")
|
||||
private String dictType;
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
@ApiModelProperty("样式属性(其他样式扩展)")
|
||||
private Boolean isType;
|
||||
/**
|
||||
* 表格回显样式
|
||||
*/
|
||||
@ApiModelProperty("表格回显样式")
|
||||
private String listClass;
|
||||
/**
|
||||
* 字典显示主题(ui框架时)or文字颜色(自定义颜色时)
|
||||
*/
|
||||
@ApiModelProperty("字典显示主题(ui框架时)or文字颜色(自定义颜色时)")
|
||||
private String theme;
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
@ApiModelProperty("是否默认(Y是 N否)")
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(1正常 0停用)",required = true)
|
||||
@NotNull(message = "状态不能为空!")
|
||||
private String state;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("字典类型实体")
|
||||
public class DictTypeDto {
|
||||
|
||||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@ApiModelProperty("字典主键")
|
||||
private Long dictId;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@ApiModelProperty("字典名称")
|
||||
@NotNull(message = "字典名称不能为空!")
|
||||
private String dictName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
@NotNull(message = "字典类型不能为空!")
|
||||
private String dictType;
|
||||
/**
|
||||
* 字典状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("字典状态")
|
||||
@NotNull(message = "字典状态不能为空!")
|
||||
private String state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
@Data
|
||||
public class IpBackDto {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@NotBlank(message = "ip地址不能为空")
|
||||
@ApiModelProperty("ip地址")
|
||||
private String ipAddr;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.fateverse.common.decrypt.annotation.EncryptField;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 16:37
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("接口开关Dto")
|
||||
public class MappingSwitchDto {
|
||||
/**
|
||||
* key作为唯一编号
|
||||
*/
|
||||
@NotBlank(message = "唯一编号不能为空")
|
||||
@ApiModelProperty("唯一编号不能为空")
|
||||
@EncryptField
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 当前方法的状态,true为正常放行,false为关闭
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@ApiModelProperty("当前方法的状态,true为正常放行,false为关闭")
|
||||
private Boolean state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 菜单详细返回对象
|
||||
*
|
||||
* @author Clay
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("菜单")
|
||||
public class MenuDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty("菜单ID")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||
@ApiModelProperty("菜单名称")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@ApiModelProperty("父菜单ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
@ApiModelProperty("路由地址")
|
||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("路径参数")
|
||||
private String pathParams;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
@ApiModelProperty("组件路径")
|
||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 是否为外链(0是 1否)
|
||||
*/
|
||||
@ApiModelProperty("是否为外链(0是 1否)")
|
||||
private Boolean isFrame;
|
||||
|
||||
/**
|
||||
* 是否缓存(0缓存 1不缓存)
|
||||
*/
|
||||
@ApiModelProperty("是否缓存(0缓存 1不缓存)")
|
||||
private Boolean isCache;
|
||||
|
||||
@ApiModelProperty("不重定向")
|
||||
private Boolean noRedirect;
|
||||
|
||||
@ApiModelProperty("面包屑")
|
||||
private Boolean breadcrumb;
|
||||
|
||||
/**
|
||||
* 类型(D目录 M菜单 B按钮)
|
||||
*/
|
||||
@ApiModelProperty("类型(D目录 M菜单 B按钮)")
|
||||
@NotBlank(message = "菜单类型不能为空")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 显示状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty("显示状态(0显示 1隐藏)")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 菜单状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty("菜单状态(0显示 1隐藏)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
@ApiModelProperty("权限字符串")
|
||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||
private String perms;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@ApiModelProperty("菜单图标")
|
||||
private String icon;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("岗位实体")
|
||||
public class PostDto {
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@ApiModelProperty("岗位ID")
|
||||
private Long postId;
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@ApiModelProperty("岗位编码")
|
||||
@NotNull(message = "岗位编码不能为空!")
|
||||
private String postCode;
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@ApiModelProperty("岗位名称")
|
||||
@NotNull(message = "岗位名称不能为空!")
|
||||
private String postName;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空!")
|
||||
private Integer postSort;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(1正常 0停用)")
|
||||
@NotNull(message = "状态不能为空!")
|
||||
private String state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/5
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("角色接受对象")
|
||||
public class RoleDto {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty("角色id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@ApiModelProperty("角色名称")
|
||||
@NotBlank(message = "角色名称不能为空!")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色关键词
|
||||
*/
|
||||
@ApiModelProperty("角色关键词")
|
||||
@NotBlank(message = "角色关键词不能为空!")
|
||||
private String roleKey;
|
||||
|
||||
/**
|
||||
* 角色排序
|
||||
*/
|
||||
@ApiModelProperty("角色排序")
|
||||
@NotNull(message = "角色排序不能为空!")
|
||||
private Integer roleSort;
|
||||
|
||||
/**
|
||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限)
|
||||
*/
|
||||
@ApiModelProperty("数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限)")
|
||||
private String dataScope;
|
||||
|
||||
/**
|
||||
* 角色状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("角色状态(1正常 0停用)")
|
||||
@NotBlank(message = "角色状态不能为空!")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 菜单组
|
||||
*/
|
||||
@ApiModelProperty("菜单组")
|
||||
private Set<Long> menuIds;
|
||||
|
||||
/**
|
||||
* 部门组(数据权限)
|
||||
*/
|
||||
@ApiModelProperty("部门组(数据权限)")
|
||||
private Long[] deptIds;
|
||||
|
||||
public Role toRole() {
|
||||
return Role.builder()
|
||||
.roleId(roleId)
|
||||
.roleName(roleName)
|
||||
.roleKey(roleKey)
|
||||
.roleSort(roleSort)
|
||||
.dataScope(dataScope)
|
||||
.state(state)
|
||||
.delFlag("0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package cn.fateverse.admin.dto;
|
||||
|
||||
import cn.fateverse.admin.entity.UserBase;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/7
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("用户返回实体")
|
||||
public class UserDto{
|
||||
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@NotBlank(message = "用户名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@NotBlank(message = "用户昵称不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 岗位ids
|
||||
*/
|
||||
@ApiModelProperty("岗位ids")
|
||||
private List<Long> postIds;
|
||||
/**
|
||||
* 角色ids
|
||||
*/
|
||||
@ApiModelProperty("角色ids")
|
||||
private List<Long> roleIds;
|
||||
|
||||
|
||||
public UserBase toUser() {
|
||||
return UserBase.builder()
|
||||
.userId(userId)
|
||||
.deptId(deptId)
|
||||
.userName(userName)
|
||||
.nickName(nickName)
|
||||
.email(email)
|
||||
.phoneNumber(phoneNumber)
|
||||
.sex(sex)
|
||||
.password(password)
|
||||
.state(state)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.vo.DeptVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface DubboDeptService {
|
||||
/**
|
||||
* 通过部门id获取到部门信息
|
||||
*
|
||||
* @param deptIds 部门列表
|
||||
* @return 返回部门信息
|
||||
*/
|
||||
List<DeptVo> searchDeptByDeptId(List<Long> deptIds);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.vo.DictDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
|
||||
public interface DubboDictDataService {
|
||||
|
||||
/**
|
||||
* 获取到字典缓存
|
||||
*
|
||||
* @param cacheKeys 字典缓存key
|
||||
* @return 映射完成的字典对象
|
||||
*/
|
||||
Map<String, Map<String, DictDataVo>> searchDictDataCacheKeys(List<String> cacheKeys);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.dto.MenuDto;
|
||||
import cn.fateverse.admin.vo.MenuVo;
|
||||
import cn.fateverse.admin.vo.RouterVo;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface DubboMenuService {
|
||||
/**
|
||||
* 获取到用户的菜单权限信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 当前用户的权限信息
|
||||
*/
|
||||
Set<String> selectMenuPermsByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 保存登录信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 当前用户的路由信息
|
||||
*/
|
||||
List<RouterVo> selectMenuRouterByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
*
|
||||
* @param menuDto 菜单对象
|
||||
* @return 操作结果
|
||||
*/
|
||||
Result<Long> insertMenu(MenuDto menuDto);
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
*
|
||||
* @param menuId 菜单id
|
||||
*/
|
||||
void removeMenu(Long menuId);
|
||||
|
||||
/**
|
||||
* 根据id查询父级菜单信息
|
||||
*
|
||||
* @param menuId 父级菜单
|
||||
* @return 菜单信息
|
||||
*/
|
||||
Result<MenuVo> selectMenuByMenuId(Long menuId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-05-06
|
||||
*/
|
||||
public interface DubboRoleService {
|
||||
|
||||
/**
|
||||
* 根据角色id获取到角色name
|
||||
*
|
||||
* @param roleIds 角色id
|
||||
* @return 角色名称
|
||||
*/
|
||||
List<String> searchRoleNameByIds(List<Long> roleIds);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.entity.User;
|
||||
import cn.fateverse.admin.vo.UserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
|
||||
public interface DubboUserService {
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
* @param username 用户名称
|
||||
* @return 用户信息
|
||||
*/
|
||||
User getUserByUsername(String username);
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 用户信息
|
||||
*/
|
||||
User getUserByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据roleId查询用户列表
|
||||
*
|
||||
* @param roleIds 角色id列表
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
List<UserVo> searchUserListByRoleIds(List<Long> roleIds);
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户信息
|
||||
*
|
||||
* @param userIds 用户id列表
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
List<UserVo> searchUserListByUserIds(List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 根据部门id查询用户信息
|
||||
*
|
||||
* @param deptIds 部门信息列表
|
||||
* @return 部门列表
|
||||
*/
|
||||
List<UserVo> searchUserByDeptIds(List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 获取所有的用户id
|
||||
*
|
||||
* @return 所有用户的id
|
||||
*/
|
||||
List<Long> searchAllUserIds();
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* 参数配置表对象 sys_config
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EnableAutoField
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Config extends BaseEntity{
|
||||
|
||||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
private Integer configId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 系统内置(1是 0否)
|
||||
*/
|
||||
private Integer configType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Data
|
||||
@EnableAutoField
|
||||
public class Dept extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空!")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@NotNull(message = "显示顺序不能为空!")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@NotBlank(message = "负责人不能为空!")
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
@NotNull(message = "负责人id不能为空!")
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Pattern(message = "手机号格式错误!",regexp = "^1[0-9]{10}$")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Email(message = "邮箱格式错误!")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:1正常,0停用
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.admin.dto.DictDataDto;
|
||||
import cn.fateverse.admin.vo.DictDataSimpVo;
|
||||
import cn.fateverse.admin.vo.DictDataVo;
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EnableAutoField
|
||||
public class DictData extends BaseEntity {
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private Long dictCode;
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
private Integer dictSort;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
private String dictValue;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
private String dictType;
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
private Boolean isType;
|
||||
/**
|
||||
* 表格回显样式
|
||||
*/
|
||||
private String listClass;
|
||||
/**
|
||||
* 字典显示主题(ui框架时)or文字颜色(自定义颜色时)
|
||||
*/
|
||||
private String theme;
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
public static DictData toDictData(DictDataDto dto) {
|
||||
return DictData.builder()
|
||||
.dictCode(dto.getDictCode())
|
||||
.dictSort(dto.getDictSort())
|
||||
.dictLabel(dto.getDictLabel())
|
||||
.dictValue(dto.getDictValue())
|
||||
.dictType(dto.getDictType())
|
||||
.isType(dto.getIsType())
|
||||
.listClass(dto.getListClass())
|
||||
.theme(dto.getTheme())
|
||||
.isDefault(dto.getIsDefault())
|
||||
.state(dto.getState())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static DictDataVo toDictDataListVo(DictData dict) {
|
||||
return DictDataVo.builder()
|
||||
.dictCode(dict.getDictCode())
|
||||
.dictLabel(dict.getDictLabel())
|
||||
.dictSort(dict.getDictSort())
|
||||
.dictValue(dict.getDictValue())
|
||||
.dictType(dict.getDictType())
|
||||
.isDefault(dict.getIsDefault())
|
||||
.isType(dict.getIsType())
|
||||
.state(dict.getState())
|
||||
.listClass(dict.getListClass())
|
||||
.theme(dict.getTheme())
|
||||
.createTime(dict.getCreateTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典对象转换成为Option对象
|
||||
*
|
||||
* @param dictData 字典对象
|
||||
* @return Option选项
|
||||
*/
|
||||
public static Option dictDataToOption(DictData dictData) {
|
||||
return Option.builder()
|
||||
.value(dictData.getDictValue())
|
||||
.label(dictData.getDictLabel())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将DictData对象转换为DictDataVo对象
|
||||
*
|
||||
* @param dict 待转换的DictData对象
|
||||
* @return 转换后的DictDataVo对象
|
||||
*/
|
||||
public static DictDataVo toDictDataVo(DictData dict) {
|
||||
DictDataVo dataVo = new DictDataVo();
|
||||
BeanUtils.copyProperties(dict, dataVo);
|
||||
return dataVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 字典对象转换成为简单的字典返回Vo
|
||||
*
|
||||
* @param dictData 字典对象
|
||||
* @return 简单vo对象
|
||||
*/
|
||||
public static DictDataSimpVo toDictDataSimpVo(DictData dictData) {
|
||||
return DictDataSimpVo.builder()
|
||||
.label(dictData.getDictLabel())
|
||||
.value(dictData.getDictValue())
|
||||
.isType(dictData.getIsType())
|
||||
.listClass(dictData.getListClass())
|
||||
.theme(dictData.getTheme())
|
||||
.isDefault(dictData.getIsDefault())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
@EnableAutoField
|
||||
@ApiModel("字典类型实体")
|
||||
public class DictType extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@ApiModelProperty("字典主键")
|
||||
private Long dictId;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@ApiModelProperty("字典名称")
|
||||
@NotNull(message = "字典名称不能为空!")
|
||||
private String dictName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
@NotNull(message = "字典类型不能为空!")
|
||||
private String dictType;
|
||||
/**
|
||||
* 字典状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("字典状态")
|
||||
@NotNull(message = "字典状态不能为空!")
|
||||
private String state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.admin.vo.IpBackVo;
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
@Data
|
||||
@EnableAutoField
|
||||
public class IpBack extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
private String ipAddr;
|
||||
/**
|
||||
* ip类型 ipv4 ipv6
|
||||
*/
|
||||
private String type;
|
||||
|
||||
public IpBackVo toIPBackVo(){
|
||||
return IpBackVo.builder()
|
||||
.id(id)
|
||||
.ipAddr(ipAddr)
|
||||
.type(type)
|
||||
.createTime(getCreateTime())
|
||||
.remark(getRemark())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 菜单权限表 sys_menu
|
||||
*
|
||||
* @author Clay
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EnableAutoField
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Menu extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 路径参数
|
||||
*/
|
||||
private String pathParams;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 是否为外链(1是 0否)
|
||||
*/
|
||||
private Boolean isFrame;
|
||||
|
||||
/**
|
||||
* 是否缓存(1 缓存 0不缓存)
|
||||
*/
|
||||
private Boolean isCache;
|
||||
|
||||
|
||||
private Boolean noRedirect;
|
||||
|
||||
|
||||
private Boolean breadcrumb;
|
||||
/**
|
||||
* 类型(D目录 M菜单 B按钮)
|
||||
*/
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 显示状态(1显示 0隐藏)
|
||||
*/
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 菜单状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
private String perms;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("在线用户实体")
|
||||
public class OnlineUser {
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
@ApiModelProperty("会话id")
|
||||
private String tokenId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
/**
|
||||
* 登录ip
|
||||
*/
|
||||
@ApiModelProperty("登录ip")
|
||||
private String ipAddr;
|
||||
/**
|
||||
* 登录地点
|
||||
*/
|
||||
@ApiModelProperty("登录地点")
|
||||
private String loginLocation;
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
@ApiModelProperty("浏览器类型")
|
||||
private String browser;
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@ApiModelProperty("操作系统")
|
||||
private String os;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
@ApiModelProperty("登录时间")
|
||||
private Date loginTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
@Data
|
||||
@EnableAutoField
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Post extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private Long postId;
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
private String postCode;
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String postName;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer postSort;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EnableAutoField
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Role extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色关键词
|
||||
*/
|
||||
private String roleKey;
|
||||
|
||||
/**
|
||||
* 角色排序
|
||||
*/
|
||||
private Integer roleSort;
|
||||
|
||||
/**
|
||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限)
|
||||
*/
|
||||
private String dataScope;
|
||||
|
||||
/**
|
||||
* 角色状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String delFlag;
|
||||
|
||||
private Integer roleType = 0;
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(this.roleId);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public static boolean isAdmin(Long roleId) {
|
||||
return roleId != null && 1L == roleId;
|
||||
}
|
||||
|
||||
public Role(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/6
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class RoleMenu {
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
/**
|
||||
* 菜单id
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@Data
|
||||
public class User extends UserBase {
|
||||
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
private Dept dept;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
private List<Role> roles;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(super.getUserId());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public static boolean isAdmin(Long userId) {
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.EnableAutoField;
|
||||
import cn.fateverse.common.core.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/7
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EnableAutoField
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserBase extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 盐加密
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String delFlag;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 一个微信开放平台帐号下的应用,同一用户的 union
|
||||
*/
|
||||
private String unionId;
|
||||
/**
|
||||
* 用户唯一标识
|
||||
*/
|
||||
private String openId;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date loginDate;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class UserPost {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.fateverse.admin.entity;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/6
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class UserRole {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 参数配置表对象 sys_config
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("参数配置表Query")
|
||||
public class ConfigQuery {
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@ApiModelProperty("参数键名")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 系统内置(1是 0否)
|
||||
*/
|
||||
@ApiModelProperty("系统内置(1是 0否)")
|
||||
private Integer configType;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
public class DictDataQuery {
|
||||
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty(value = "字典名称",required = true)
|
||||
private String dictType;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@ApiModelProperty("字典标签")
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import cn.fateverse.common.core.entity.QueryTime;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
public class DictTypeQuery extends QueryTime {
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@ApiModelProperty("字典名称")
|
||||
private String dictName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import cn.fateverse.common.core.annotaion.Excel;
|
||||
import cn.fateverse.common.core.entity.QueryTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
@Data
|
||||
public class IpBackQuery extends QueryTime {
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
private String ipAddr;
|
||||
|
||||
/**
|
||||
* ip类型 ipv4 ipv6
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 14:35
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("接口开关Query")
|
||||
public class MappingSwitchQuery {
|
||||
|
||||
@ApiModelProperty("应用名称")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty("类别名称")
|
||||
private String className;
|
||||
|
||||
@ApiModelProperty("方法名称")
|
||||
private String methodName;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PostQuery {
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@ApiModelProperty("岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@ApiModelProperty("岗位名称")
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(1正常 0停用)")
|
||||
private String state;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import cn.fateverse.common.core.entity.QueryTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/4
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("角色查询实体")
|
||||
public class RoleQuery extends QueryTime {
|
||||
/**
|
||||
* 权限字符
|
||||
*/
|
||||
@ApiModelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 权限字符
|
||||
*/
|
||||
@ApiModelProperty("权限字符")
|
||||
private String roleKey;
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.fateverse.admin.query;
|
||||
|
||||
import cn.fateverse.common.core.entity.QueryTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("用户查询对象")
|
||||
public class UserQuery extends QueryTime {
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ApiModelProperty("用户账号")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@ApiModelProperty("手机号码")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.Config;
|
||||
import cn.fateverse.common.core.annotaion.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 参数配置表对象 sys_config
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("参数配置表Vo")
|
||||
public class ConfigVo {
|
||||
|
||||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
@ApiModelProperty("参数主键")
|
||||
private Integer configId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@ApiModelProperty("参数名称")
|
||||
@Excel("参数名称")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@ApiModelProperty("参数键名")
|
||||
@Excel("参数键名")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
@ApiModelProperty("参数键值")
|
||||
@Excel("参数键值")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 系统内置(1是 0否)
|
||||
*/
|
||||
@ApiModelProperty("系统内置(1是 0否)")
|
||||
@Excel("系统内置(1是 0否)")
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
@Excel("备注")
|
||||
private String remark;
|
||||
|
||||
public static ConfigVo toConfigVo(Config config) {
|
||||
return ConfigVo.builder()
|
||||
.configId(config.getConfigId())
|
||||
.configName(config.getConfigName())
|
||||
.configKey(config.getConfigKey())
|
||||
.configValue(config.getConfigValue())
|
||||
.configType(config.getConfigType())
|
||||
.remark(config.getRemark())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeptVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
/**
|
||||
* 负责人Id
|
||||
*/
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:1正常,0停用
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
private List<DeptVo> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.DictData;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/11
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("Cache字典数据实体")
|
||||
public class DictDataSimpVo {
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@ApiModelProperty("字典标签")
|
||||
@NotNull(message = "字典标签不能为空!")
|
||||
private String label;
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
@ApiModelProperty("字典键值")
|
||||
@NotNull(message = "字典键值不能为空!")
|
||||
private String value;
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
@ApiModelProperty("样式属性(其他样式扩展)")
|
||||
private Boolean isType;
|
||||
/**
|
||||
* 表格回显样式
|
||||
*/
|
||||
@ApiModelProperty("表格回显样式")
|
||||
private String listClass;
|
||||
/**
|
||||
* 字典显示主题(ui框架时)or文字颜色(自定义颜色时)
|
||||
*/
|
||||
@ApiModelProperty("字典显示主题(ui框架时)or文字颜色(自定义颜色时)")
|
||||
private String theme;
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
@ApiModelProperty("是否默认(Y是 N否)")
|
||||
private Integer isDefault;
|
||||
|
||||
|
||||
/**
|
||||
* 字典对象转换成为简单的字典返回Vo
|
||||
*
|
||||
* @param dictData 字典对象
|
||||
* @return 简单vo对象
|
||||
*/
|
||||
public static DictDataSimpVo dictDataToDictDataVo(DictData dictData) {
|
||||
return DictDataSimpVo.builder()
|
||||
.label(dictData.getDictLabel())
|
||||
.value(dictData.getDictValue())
|
||||
.isType(dictData.getIsType())
|
||||
.listClass(dictData.getListClass())
|
||||
.isDefault(dictData.getIsDefault())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 字典数据返回vo
|
||||
*
|
||||
* @author Clay
|
||||
* @date 2023/05/18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DictDataVo implements Serializable {
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private Long dictCode;
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
@ApiModelProperty("字典排序")
|
||||
private Integer dictSort;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@ApiModelProperty("字典标签")
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
@ApiModelProperty("字典键值")
|
||||
private String dictValue;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
private String dictType;
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
@ApiModelProperty("样式属性(其他样式扩展)")
|
||||
private Boolean isType;
|
||||
/**
|
||||
* 表格回显样式
|
||||
*/
|
||||
@ApiModelProperty("表格回显样式")
|
||||
private String listClass;
|
||||
/**
|
||||
* 字典显示主题(ui框架时)or文字颜色(自定义颜色时)
|
||||
*/
|
||||
@ApiModelProperty("字典显示主题(ui框架时)or文字颜色(自定义颜色时)")
|
||||
private String theme;
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
@ApiModelProperty("是否默认(Y是 N否)")
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("字典返回实体")
|
||||
public class DictTypeVo {
|
||||
/**
|
||||
* 字典id
|
||||
*/
|
||||
@ApiModelProperty("字典id")
|
||||
private Long dictId;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@ApiModelProperty("字典名称")
|
||||
private String dictName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty("字典类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.IpBack;
|
||||
import cn.fateverse.common.core.annotaion.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("ip黑名单")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IpBackVo {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty("主键id")
|
||||
@Excel("id")
|
||||
private Long id;
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@ApiModelProperty("ip地址")
|
||||
@Excel("ip地址")
|
||||
private String ipAddr;
|
||||
/**
|
||||
* ip类型 ipv4 ipv6
|
||||
*/
|
||||
@ApiModelProperty("ip类型 ipv4 ipv6")
|
||||
@Excel("ip类型 ipv4 ipv6")
|
||||
private String type;
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@Excel("备注信息")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@Excel("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
public static IpBackVo toIpBackVo(IpBack ipBack) {
|
||||
return IpBackVo.builder()
|
||||
.id(ipBack.getId())
|
||||
.ipAddr(ipBack.getIpAddr())
|
||||
.type(ipBack.getType())
|
||||
.remark(ipBack.getRemark())
|
||||
.createTime(ipBack.getCreateTime())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/5
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("菜单返回实体")
|
||||
public class MenuSimpVo {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty("菜单ID")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@ApiModelProperty("菜单名称")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@ApiModelProperty("菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
|
||||
@ApiModelProperty("显示顺序")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
@ApiModelProperty("权限字符串")
|
||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||
private String perms;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
@ApiModelProperty("组件路径")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 菜单状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty("菜单状态(0显示 1隐藏)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
private List<MenuSimpVo> children;
|
||||
|
||||
}
|
||||
104
admin/admin-api/src/main/java/cn/fateverse/admin/vo/MenuVo.java
Normal file
104
admin/admin-api/src/main/java/cn/fateverse/admin/vo/MenuVo.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 菜单详细返回对象
|
||||
*
|
||||
* @author Clay
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("菜单")
|
||||
public class MenuVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty("菜单ID")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@ApiModelProperty("菜单名称")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@ApiModelProperty("父菜单ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
@ApiModelProperty("路由地址")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("路径参数")
|
||||
private String pathParams;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
@ApiModelProperty("组件路径")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 是否为外链(0是 1否)
|
||||
*/
|
||||
@ApiModelProperty("是否为外链(0是 1否)")
|
||||
private Boolean isFrame;
|
||||
|
||||
/**
|
||||
* 是否缓存(0缓存 1不缓存)
|
||||
*/
|
||||
@ApiModelProperty("是否缓存(0缓存 1不缓存)")
|
||||
private Boolean isCache;
|
||||
|
||||
@ApiModelProperty("不重定向")
|
||||
private Boolean noRedirect;
|
||||
|
||||
@ApiModelProperty("面包屑")
|
||||
private Boolean breadcrumb;
|
||||
/**
|
||||
* 类型(D目录 M菜单 B按钮)
|
||||
*/
|
||||
@ApiModelProperty("类型(D目录 M菜单 B按钮)")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 显示状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty("显示状态(0显示 1隐藏)")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 菜单状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty("菜单状态(0显示 1隐藏)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
@ApiModelProperty("权限字符串")
|
||||
private String perms;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@ApiModelProperty("菜单图标")
|
||||
private String icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Data
|
||||
public class MetaVo implements Serializable {
|
||||
/**
|
||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 设置为true,则不会被 <keep-alive>缓存
|
||||
*/
|
||||
private Boolean noCache;
|
||||
|
||||
/**
|
||||
* 是否重定向
|
||||
*/
|
||||
private Boolean noRedirect;
|
||||
|
||||
/**
|
||||
* 是否开起面包屑
|
||||
*/
|
||||
private Boolean breadcrumb;
|
||||
|
||||
private Boolean isFrame;
|
||||
|
||||
public MetaVo() {
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, Boolean noCache) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, Boolean noCache, Boolean noRedirect, Boolean breadcrumb,Boolean isFrame) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
this.noRedirect = noRedirect;
|
||||
this.breadcrumb = breadcrumb;
|
||||
this.isFrame = isFrame;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.common.core.entity.OptionTree;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/6
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("角色修改时菜单返回实体")
|
||||
public class OptionMenuVo {
|
||||
|
||||
@ApiModelProperty("已选择的")
|
||||
private Set<Long> checked;
|
||||
@ApiModelProperty("菜单选择option")
|
||||
private List<OptionTree> menuOption;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.Post;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("岗位实体")
|
||||
public class PostVo {
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@ApiModelProperty("岗位ID")
|
||||
private Long postId;
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@ApiModelProperty("岗位编码")
|
||||
@NotNull(message = "岗位编码不能为空!")
|
||||
private String postCode;
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@ApiModelProperty("岗位名称")
|
||||
@NotNull(message = "岗位名称不能为空!")
|
||||
private String postName;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空!")
|
||||
private Integer postSort;
|
||||
/**
|
||||
* 状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(1正常 0停用)")
|
||||
@NotNull(message = "状态不能为空!")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
public static PostVo toPostVo(Post post){
|
||||
return PostVo.builder()
|
||||
.postId(post.getPostId())
|
||||
.postCode(post.getPostCode())
|
||||
.postName(post.getPostName())
|
||||
.postSort(post.getPostSort())
|
||||
.state(post.getState())
|
||||
.createTime(post.getCreateTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-05-26
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RoleVo {
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
|
||||
@ApiModelProperty("角色权限字符串")
|
||||
private String roleKey;
|
||||
|
||||
@ApiModelProperty("角色排序")
|
||||
private Integer roleSort;
|
||||
|
||||
/**
|
||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限)
|
||||
*/
|
||||
@ApiModelProperty("数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限)")
|
||||
private String dataScope;
|
||||
|
||||
/**
|
||||
* 角色状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("角色状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 菜单组
|
||||
*/
|
||||
@ApiModelProperty("菜单组")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Set<Long> menuIds;
|
||||
|
||||
/**
|
||||
* 部门组(数据权限)
|
||||
*/
|
||||
@ApiModelProperty("部门组(数据权限)")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Long[] deptIds;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public static RoleVo toRoleVo(Role role){
|
||||
return RoleVo.builder()
|
||||
.roleId(role.getRoleId())
|
||||
.roleName(role.getRoleName())
|
||||
.roleKey(role.getRoleKey())
|
||||
.roleSort(role.getRoleSort())
|
||||
.dataScope(role.getDataScope())
|
||||
.state(role.getState())
|
||||
.createTime(role.getCreateTime())
|
||||
.updateTime(role.getUpdateTime())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RouterVo implements Serializable {
|
||||
/**
|
||||
* 路由名字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 路径参数
|
||||
*/
|
||||
private String pathParams;
|
||||
|
||||
/**
|
||||
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
|
||||
*/
|
||||
private boolean hidden;
|
||||
|
||||
/**
|
||||
* 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
||||
*/
|
||||
@JsonInclude(NON_NULL)
|
||||
private String redirect;
|
||||
|
||||
/**
|
||||
* 组件地址
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
|
||||
*/
|
||||
@JsonInclude(NON_NULL)
|
||||
private Boolean alwaysShow;
|
||||
|
||||
/**
|
||||
* 其他元素
|
||||
*/
|
||||
private MetaVo meta;
|
||||
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
@JsonInclude(NON_NULL)
|
||||
private List<RouterVo> children;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import cn.fateverse.admin.entity.Dept;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-03-02
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class UserChooseVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String value;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private List<UserChooseVo> children;
|
||||
|
||||
|
||||
public static UserChooseVo toUserChooseByDept(Dept dept, Long id) {
|
||||
return UserChooseVo.builder()
|
||||
.id(dept.getDeptId())
|
||||
.type(2)
|
||||
.value(id + "-" + dept.getDeptId())
|
||||
.children(new ArrayList<>())
|
||||
.name(dept.getDeptName())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static UserChooseVo toUserChooseByRole(Role role) {
|
||||
return UserChooseVo.builder()
|
||||
.id(role.getRoleId())
|
||||
.type(1)
|
||||
.value("0-" + role.getRoleId())
|
||||
.children(new ArrayList<>())
|
||||
.name(role.getRoleName())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static UserChooseVo toUserChooseByUser(UserVo user, long id) {
|
||||
return UserChooseVo.builder()
|
||||
.id(user.getUserId())
|
||||
.type(0)
|
||||
.value(id + "-" + user.getUserId())
|
||||
.children(new ArrayList<>())
|
||||
.avatar(user.getAvatar())
|
||||
.name(user.getNickName())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.fateverse.admin.entity.User;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/4
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("用户详细信息")
|
||||
public class UserDetailVo {
|
||||
@ApiModelProperty("用户基本细腻系")
|
||||
private User user;
|
||||
|
||||
@ApiModelProperty("用户所在的岗位")
|
||||
private List<Long> postIds;
|
||||
|
||||
@ApiModelProperty("岗位option选择数组")
|
||||
private List<Option> postList;
|
||||
|
||||
@ApiModelProperty("用户所拥有的的角色信息")
|
||||
private List<Long> roleIds;
|
||||
|
||||
@ApiModelProperty("角色option选择数组")
|
||||
private List<Option> roleList;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package cn.fateverse.admin.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("用户返回实体")
|
||||
public class UserVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
private Long leaderDeptId;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ApiModelProperty("用户账号")
|
||||
private String userName;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private String email;
|
||||
|
||||
private String userType;
|
||||
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@ApiModelProperty("用户昵称")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@ApiModelProperty("手机号码")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 帐号状态(1正常 0停用)
|
||||
*/
|
||||
@ApiModelProperty("帐号状态(1正常 0停用)")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
public boolean checkEmail(){
|
||||
if (StrUtil.isEmpty(email)){
|
||||
return false;
|
||||
}
|
||||
Pattern pattern =Pattern.compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
|
||||
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");
|
||||
return pattern.matcher(email).matches();
|
||||
}
|
||||
}
|
||||
1
admin/admin-biz/README.md
Normal file
1
admin/admin-biz/README.md
Normal file
@@ -0,0 +1 @@
|
||||
字典模块添加布隆过滤器
|
||||
74
admin/admin-biz/pom.xml
Normal file
74
admin/admin-biz/pom.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?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>admin</artifactId>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>admin-biz</artifactId>
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--通用模块-->
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
</dependency>
|
||||
<!--文件组件-->
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-file</artifactId>
|
||||
</dependency>
|
||||
<!--seata 分布式事务-->
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-seata</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.fateverse</groupId>
|
||||
<artifactId>common-decrypt</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.7.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.fateverse.admin;
|
||||
|
||||
import cn.fateverse.common.security.annotation.EnableSecurity;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@EnableSecurity
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class AdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminApplication.class,args);
|
||||
System.out.println("admin模块启动成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.ConfigDto;
|
||||
import cn.fateverse.admin.query.ConfigQuery;
|
||||
import cn.fateverse.admin.vo.ConfigVo;
|
||||
import cn.fateverse.admin.service.ConfigService;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.ObjectUtils;
|
||||
import cn.fateverse.common.excel.utils.ExcelUtil;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置表 Controller
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
@Api(value = "参数配置表管理",tags = "参数配置表管理")
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
public class ConfigController {
|
||||
|
||||
private final ConfigService configService;
|
||||
|
||||
public ConfigController(ConfigService configService) {
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取参数配置表列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:list')")
|
||||
public Result<TableDataInfo<ConfigVo>> list(ConfigQuery query) {
|
||||
TableDataInfo<ConfigVo> dataInfo = configService.searchList(query);
|
||||
return Result.ok(dataInfo);
|
||||
}
|
||||
@ApiOperation("获取参数配置表列表Page")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:list')")
|
||||
public Result<TableDataInfo<ConfigVo>> listPage(ConfigQuery query) {
|
||||
TableDataInfo<ConfigVo> dataInfo = configService.searchListPage(query);
|
||||
return Result.ok(dataInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("导出excel数据")
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:export')")
|
||||
public void export(ConfigQuery query){
|
||||
List<ConfigVo> list = configService.exportList(query);
|
||||
ExcelUtil.exportExcel(list,ConfigVo.class);
|
||||
}
|
||||
|
||||
@ApiOperation("获取参数配置表详细信息")
|
||||
@GetMapping("/{configId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:info')")
|
||||
public Result<ConfigVo> info(@PathVariable Integer configId) {
|
||||
ObjectUtils.checkPk(configId);
|
||||
ConfigVo config = configService.searchById(configId);
|
||||
return Result.ok(config);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增参数配置表")
|
||||
@PostMapping
|
||||
@Log(title = "新增参数配置表",businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:add')")
|
||||
public Result<Void> add(@RequestBody @Validated ConfigDto config){
|
||||
configService.save(config);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改参数配置表")
|
||||
@PutMapping
|
||||
@Log(title = "修改参数配置表",businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:edit')")
|
||||
public Result<Void> edit(@RequestBody @Validated ConfigDto config){
|
||||
ObjectUtils.checkPk(config.getConfigId());
|
||||
configService.edit(config);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除参数配置表")
|
||||
@DeleteMapping("/{configIdList}")
|
||||
@Log(title = "删除参数配置表",businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:config:del')")
|
||||
public Result<Void> batchDel(@PathVariable List<Integer> configIdList){
|
||||
ObjectUtils.checkPkList(configIdList);
|
||||
configService.removeBatch(configIdList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.DeptDto;
|
||||
import cn.fateverse.admin.vo.DeptVo;
|
||||
import cn.fateverse.admin.service.DeptService;
|
||||
import cn.fateverse.common.core.constant.UserConstants;
|
||||
import cn.fateverse.admin.entity.Dept;
|
||||
import cn.fateverse.common.core.entity.OptionTree;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
@Api(tags = "部门接口")
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class DeptController {
|
||||
|
||||
private final DeptService deptService;
|
||||
|
||||
|
||||
public DeptController(DeptService deptService) {
|
||||
this.deptService = deptService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取列表信息")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dept:list')")
|
||||
public Result<List<DeptVo>> list(
|
||||
@ApiParam(name="deptName",value="部门名称") String deptName,
|
||||
@ApiParam(name="state",value="状态(1: 正常 0 : 停用)") Integer state){
|
||||
List<DeptVo> deptVoList = deptService.searchTree(deptName, state);
|
||||
return Result.ok(deptVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取部门详情")
|
||||
@GetMapping("/{deptId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:dept:info')")
|
||||
public Result<DeptVo> info(
|
||||
@ApiParam(name="deptId",value="部门id")
|
||||
@PathVariable Long deptId){
|
||||
checkDeptId(deptId);
|
||||
DeptVo deptVo = deptService.searchById(deptId);
|
||||
return Result.ok(deptVo);
|
||||
}
|
||||
|
||||
@ApiOperation("获取树形接口的option")
|
||||
@GetMapping("/option")
|
||||
public Result<List<OptionTree>> option(){
|
||||
List<OptionTree> optionTreeList = deptService.searchTreeOption();
|
||||
return Result.ok(optionTreeList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取修改时的部门列表")
|
||||
@GetMapping("/option/exclude/{deptId}")
|
||||
public Result<List<OptionTree>> exclude(@PathVariable Long deptId){
|
||||
checkDeptId(deptId);
|
||||
List<OptionTree> deptVoList = deptService.searchExcludeTree(deptId);
|
||||
return Result.ok(deptVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("新增部门")
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dept:add')")
|
||||
@Log(title = "新增部门",businessType = BusinessType.INSERT)
|
||||
public Result<Void> add(@RequestBody @Validated DeptDto deptDto){
|
||||
Dept dept = new Dept();
|
||||
BeanUtils.copyProperties(deptDto,dept);
|
||||
if (UserConstants.DEPT_DISABLE.equals(deptService.checkNameUnique(dept))){
|
||||
return Result.error("新增部门: "+ dept.getDeptName() +"'失败,部门名称以存在!");
|
||||
}
|
||||
deptService.save(dept);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改部门")
|
||||
@PutMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dept:edit')")
|
||||
@Log(title = "修改部门",businessType = BusinessType.UPDATE)
|
||||
public Result<Void> edit(@RequestBody @Validated DeptDto deptDto){
|
||||
Dept dept = new Dept();
|
||||
BeanUtils.copyProperties(deptDto,dept);
|
||||
if (UserConstants.DEPT_DISABLE.equals(deptService.checkNameUnique(dept))){
|
||||
return Result.error("修改部门: "+ dept.getDeptName() +"'失败,部门名称以存在!");
|
||||
}else if (dept.getDeptId().equals(dept.getParentId())){
|
||||
return Result.error("修改部门: "+ dept.getDeptName() +"'失败,上级部门不能为自己!");
|
||||
}
|
||||
checkDeptId(dept.getDeptId());
|
||||
deptService.edit(dept);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除部门")
|
||||
@DeleteMapping("/{deptId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:dept:del')")
|
||||
@Log(title = "删除部门",businessType = BusinessType.DELETE)
|
||||
public Result<Void> delete(@PathVariable Long deptId){
|
||||
checkDeptId(deptId);
|
||||
if (deptService.hasChildById(deptId)){
|
||||
return Result.error("存在下级部门,不允许删除");
|
||||
}else if (deptService.checkExistUser(deptId)){
|
||||
return Result.error("该部门下存在用户,不允许删除");
|
||||
}
|
||||
deptService.remove(deptId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查部门id是都为空
|
||||
*/
|
||||
private void checkDeptId(Long deptId){
|
||||
if (null == deptId){
|
||||
throw new CustomException("部门id不能为空!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.DictDataDto;
|
||||
import cn.fateverse.admin.query.DictDataQuery;
|
||||
import cn.fateverse.admin.vo.DictDataSimpVo;
|
||||
import cn.fateverse.admin.vo.DictDataVo;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.fateverse.admin.service.DictDataService;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.core.utils.ObjectUtils;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Api(tags = "字典数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/dict/data")
|
||||
public class DictDataController {
|
||||
private final DictDataService dictDataService;
|
||||
|
||||
public DictDataController(DictDataService dictDataService) {
|
||||
this.dictDataService = dictDataService;
|
||||
}
|
||||
|
||||
@ApiOperation("根据type名称获取缓存字典数据")
|
||||
@GetMapping("/type/{cacheKeys}")
|
||||
public Result<Map<String,List<DictDataSimpVo>>> cacheType(@PathVariable List<String> cacheKeys){
|
||||
if (ObjectUtils.isEmpty(cacheKeys)){
|
||||
return Result.error("关键参数不能为空!");
|
||||
}
|
||||
Map<String,List<DictDataSimpVo>> dictData = dictDataService.get(cacheKeys);
|
||||
return Result.ok(dictData);
|
||||
}
|
||||
|
||||
@ApiOperation("根据type名称获取缓存字典数据")
|
||||
@GetMapping("/option/{cacheKey}")
|
||||
public Result<List<Option>> cacheOption(@PathVariable String cacheKey){
|
||||
if (StrUtil.isEmpty(cacheKey)){
|
||||
return Result.error("关键参数不能为空!");
|
||||
}
|
||||
List<Option> optionList = dictDataService.option(cacheKey);
|
||||
return Result.ok(optionList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取字典数据")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:list')")
|
||||
public Result<TableDataInfo<DictDataVo>> list(DictDataQuery query){
|
||||
if (StrUtil.isEmpty(query.getDictType())){
|
||||
return Result.error("字典名称不能为空!");
|
||||
}
|
||||
TableDataInfo<DictDataVo> tableData = dictDataService.searchList(query);
|
||||
return Result.ok(tableData);
|
||||
}
|
||||
|
||||
@ApiOperation("查询字典数据详情")
|
||||
@GetMapping("/{dictCode}")
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:info')")
|
||||
public Result<DictDataVo> info(@PathVariable Long dictCode){
|
||||
LongUtils.checkId(dictCode);
|
||||
DictDataVo dictData = dictDataService.searchByCode(dictCode);
|
||||
return Result.ok(dictData);
|
||||
}
|
||||
|
||||
@ApiOperation("新增字典数据")
|
||||
@PostMapping
|
||||
@Log(title = "新增字典类型",businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:add')")
|
||||
public Result<Void> add(@RequestBody @Validated DictDataDto dto){
|
||||
dictDataService.save(dto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改字典数据")
|
||||
@PutMapping
|
||||
@Log(title = "修改字典类型",businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:edit')")
|
||||
public Result<Void> edit(@RequestBody @Validated DictDataDto dto){
|
||||
LongUtils.checkId(dto.getDictCode());
|
||||
dictDataService.edit(dto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除字典数据")
|
||||
@DeleteMapping("/{dictCode}")
|
||||
@Log(title = "删除字典类型",businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:del')")
|
||||
public Result<Void> del(@PathVariable Long dictCode){
|
||||
LongUtils.checkId(dictCode);
|
||||
dictDataService.removeByCode(dictCode);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除字典数据")
|
||||
@DeleteMapping
|
||||
@Log(title = "删除字典类型",businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('dict:data:del')")
|
||||
public Result<Void> batchDel(@RequestParam List<Long> dictCodeList){
|
||||
if (null == dictCodeList|| dictCodeList.isEmpty()){
|
||||
return Result.error("缺少必要参数!");
|
||||
}
|
||||
dictDataService.removeBatch(dictCodeList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.DictTypeDto;
|
||||
import cn.fateverse.admin.query.DictTypeQuery;
|
||||
import cn.fateverse.admin.entity.DictType;
|
||||
import cn.fateverse.admin.service.DictTypeService;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import cn.fateverse.common.mybatis.utils.PageUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Api(tags = "字典类型管理")
|
||||
@RestController
|
||||
@RequestMapping("/dict/type")
|
||||
public class DictTypeController {
|
||||
|
||||
|
||||
private final DictTypeService dictTypeService;
|
||||
|
||||
public DictTypeController(DictTypeService dictTypeService) {
|
||||
this.dictTypeService = dictTypeService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取字典类型")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('dict:type:list')")
|
||||
public Result<TableDataInfo<DictType>> list(DictTypeQuery query){
|
||||
PageUtils.startPage();
|
||||
List<DictType> dictTypeList = dictTypeService.searchList(query);
|
||||
TableDataInfo<DictType> dataTable = PageUtils.getDataTable(dictTypeList);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询字典类型Option")
|
||||
@GetMapping("/option")
|
||||
public Result<List<Option>> option(){
|
||||
List<Option> optionList = dictTypeService.searchOption();
|
||||
return Result.ok(optionList);
|
||||
}
|
||||
|
||||
@ApiOperation("查询字典类型详情")
|
||||
@GetMapping("/{dictId}")
|
||||
@PreAuthorize("@ss.hasPermission('dict:type:info')")
|
||||
public Result<DictType> info(@PathVariable Long dictId){
|
||||
LongUtils.checkId(dictId);
|
||||
DictType dictType = dictTypeService.searchById(dictId);
|
||||
return Result.ok(dictType);
|
||||
}
|
||||
|
||||
@ApiOperation("新增字典类型")
|
||||
@PostMapping
|
||||
@Log(title = "新增字典类型",businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('dict:type:add')")
|
||||
public Result<Void> add(@RequestBody @Validated DictType dictType){
|
||||
dictTypeService.save(dictType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改字典类型")
|
||||
@PutMapping
|
||||
@Log(title = "修改字典类型",businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('dict:type:edit')")
|
||||
public Result<Void> edit(@RequestBody @Validated DictTypeDto dictTypeDto){
|
||||
DictType dictType = new DictType();
|
||||
BeanUtils.copyProperties(dictTypeDto,dictType);
|
||||
LongUtils.checkId(dictType.getDictId());
|
||||
dictTypeService.edit(dictType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除字典类型")
|
||||
@DeleteMapping("/{dictId}")
|
||||
@Log(title = "删除字典类型",businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('dict:type:del')")
|
||||
public Result<Void> del(@PathVariable Long dictId){
|
||||
LongUtils.checkId(dictId);
|
||||
dictTypeService.removeById(dictId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.IpBackDto;
|
||||
import cn.fateverse.admin.query.IpBackQuery;
|
||||
import cn.fateverse.admin.service.IpBackService;
|
||||
import cn.fateverse.admin.vo.ConfigVo;
|
||||
import cn.fateverse.admin.vo.IpBackVo;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.ObjectUtils;
|
||||
import cn.fateverse.common.excel.utils.ExcelUtil;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
@Api(value = "ip黑名单", tags = "ip黑名单")
|
||||
@RestController
|
||||
@RequestMapping("/ip/back")
|
||||
public class IpBackController {
|
||||
|
||||
private final IpBackService ipBackService;
|
||||
|
||||
|
||||
public IpBackController(IpBackService ipBackService) {
|
||||
this.ipBackService = ipBackService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取ip黑名单")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:list')")
|
||||
public Result<TableDataInfo<IpBackVo>> list(IpBackQuery query) {
|
||||
TableDataInfo<IpBackVo> search = ipBackService.search(query);
|
||||
return Result.ok(search);
|
||||
}
|
||||
|
||||
@ApiOperation("导出excel数据")
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:export')")
|
||||
public void export(IpBackQuery query) {
|
||||
List<IpBackVo> list = ipBackService.exportList(query);
|
||||
ExcelUtil.exportExcel(list, IpBackVo.class);
|
||||
}
|
||||
|
||||
@ApiOperation("获取ip黑名单详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:info')")
|
||||
public Result<IpBackVo> info(@PathVariable Long id) {
|
||||
ObjectUtils.checkPk(id);
|
||||
IpBackVo ipBackVo = ipBackService.searchById(id);
|
||||
return Result.ok(ipBackVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增ip黑名单")
|
||||
@PostMapping
|
||||
@Log(title = "新增ip黑名单", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:add')")
|
||||
public Result<Void> add(@RequestBody @Validated IpBackDto ipBackDto) {
|
||||
ipBackService.save(ipBackDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改ip黑名单")
|
||||
@PutMapping
|
||||
@Log(title = "修改ip黑名单", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:edit')")
|
||||
public Result<Void> edit(@RequestBody @Validated IpBackDto ipBackDto) {
|
||||
ObjectUtils.checkPk(ipBackDto.getId());
|
||||
ipBackService.edit(ipBackDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除ip黑名单")
|
||||
@DeleteMapping("/{ids}")
|
||||
@Log(title = "删除ip黑名单", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:ipback:del')")
|
||||
public Result<Void> batchDel(@PathVariable List<Long> ids) {
|
||||
ObjectUtils.checkPkList(ids);
|
||||
ipBackService.delete(ids);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.MappingSwitchDto;
|
||||
import cn.fateverse.admin.entity.vo.MappingSwitchVo;
|
||||
import cn.fateverse.admin.query.MappingSwitchQuery;
|
||||
import cn.fateverse.admin.service.MappingSwitchService;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.decrypt.annotation.Encrypt;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 14:19
|
||||
*/
|
||||
@Api(tags = "接口开关")
|
||||
@RestController
|
||||
@RequestMapping("/mapping/switch")
|
||||
public class MapperSwitchController {
|
||||
|
||||
private final MappingSwitchService mappingSwitchService;
|
||||
|
||||
|
||||
public MapperSwitchController(MappingSwitchService mappingSwitchService) {
|
||||
this.mappingSwitchService = mappingSwitchService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取接口开关列表")
|
||||
@GetMapping
|
||||
@Encrypt
|
||||
@PreAuthorize("@ss.hasPermission('mapping:switch:list')")
|
||||
public Result<TableDataInfo<MappingSwitchVo>> list(MappingSwitchQuery query) {
|
||||
TableDataInfo<MappingSwitchVo> search = mappingSwitchService.search(query);
|
||||
return Result.ok(search);
|
||||
}
|
||||
|
||||
@ApiOperation("修改开关状态")
|
||||
@PutMapping
|
||||
@Encrypt
|
||||
@PreAuthorize("@ss.hasPermission('mapping:switch:update')")
|
||||
@Log(title = "修改开关状态", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> update(@RequestBody @Validated MappingSwitchDto dto) {
|
||||
mappingSwitchService.update(dto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.MenuDto;
|
||||
import cn.fateverse.admin.vo.MenuSimpVo;
|
||||
import cn.fateverse.admin.vo.MenuVo;
|
||||
import cn.fateverse.admin.vo.OptionMenuVo;
|
||||
import cn.fateverse.admin.service.MenuService;
|
||||
import cn.fateverse.admin.vo.RoleVo;
|
||||
import cn.fateverse.common.core.entity.OptionTree;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.core.utils.MenuTypeUtils;
|
||||
import cn.fateverse.common.core.utils.ObjectUtils;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
@Api(tags = "菜单管理")
|
||||
@RestController
|
||||
@RequestMapping("/menu")
|
||||
public class MenuController {
|
||||
|
||||
private final MenuService menuService;
|
||||
|
||||
public MenuController(MenuService menuService) {
|
||||
this.menuService = menuService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到菜单list数据,tree格式输出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取到菜单list数据,tree格式输出")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:menu:list')")
|
||||
public Result<List<MenuSimpVo>> list(@ApiParam(value = "菜单名称", name = "menuName", required = false) String menuName,
|
||||
@ApiParam(value = "状态(1:正常,0:失效)", name = "state", required = false) String state) {
|
||||
List<MenuSimpVo> menuList = menuService.searchTree(menuName, state);
|
||||
return Result.ok(menuList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取树形接口的option")
|
||||
@GetMapping("/option/{excludeId}")
|
||||
public Result<List<OptionTree>> option(@PathVariable Long excludeId) {
|
||||
if (null != excludeId && excludeId.equals(0L)){
|
||||
excludeId = null;
|
||||
}
|
||||
List<OptionTree> optionTreeList = menuService.searchTreeOption(excludeId);
|
||||
return Result.ok(optionTreeList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取树形接口的option")
|
||||
@GetMapping("/option/role/{roleId}")
|
||||
public Result<OptionMenuVo> optionRole(@PathVariable Long roleId) {
|
||||
OptionMenuVo optionMenuVo = menuService.searchOptionRoleByRoleId(roleId);
|
||||
return Result.ok(optionMenuVo);
|
||||
}
|
||||
|
||||
@ApiOperation("获取树形接口的option")
|
||||
@GetMapping("/info/{menuId}")
|
||||
public Result<MenuVo> info(@PathVariable Long menuId) {
|
||||
ObjectUtils.checkPk(menuId);
|
||||
MenuVo menu = menuService.searchByMenuId(menuId);
|
||||
return Result.ok(menu);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增菜单")
|
||||
@PostMapping
|
||||
@Log(title = "新增菜单", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('admin:menu:add')")
|
||||
public Result<Void> add(@RequestBody @Validated MenuDto menu) {
|
||||
checkMenuType(menu);
|
||||
menuService.save(menu);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("更新菜单")
|
||||
@PutMapping
|
||||
@Log(title = "更新菜单", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:menu:edit')")
|
||||
public Result<Void> edit(@RequestBody @Validated MenuDto menu) {
|
||||
checkMenuId(menu.getMenuId());
|
||||
checkMenuType(menu);
|
||||
menuService.edit(menu);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除菜单")
|
||||
@DeleteMapping("/{menuId}")
|
||||
@Log(title = "删除菜单", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:menu:del')")
|
||||
public Result<Void> del(@PathVariable Long menuId) {
|
||||
checkMenuId(menuId);
|
||||
menuService.removeById(menuId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
public void checkMenuType(MenuDto menu) {
|
||||
if (MenuTypeUtils.checkMenuTypeLegal(menu.getMenuType())) {
|
||||
throw new CustomException("菜单类型不合法!");
|
||||
}
|
||||
}
|
||||
|
||||
public void checkMenuId(Long menuId) {
|
||||
if (LongUtils.isNull(menuId)) {
|
||||
throw new CustomException("id不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.entity.OnlineUser;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.fateverse.admin.service.OnlineUserService;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/12
|
||||
*/
|
||||
@Api(tags = "在线用户")
|
||||
@RestController
|
||||
@RequestMapping("/online/user")
|
||||
public class OnlineUserController {
|
||||
|
||||
private final OnlineUserService onlineUserService;
|
||||
|
||||
public OnlineUserController(OnlineUserService onlineUserService) {
|
||||
this.onlineUserService = onlineUserService;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("获取在线用户信息")
|
||||
@PreAuthorize("@ss.hasPermission('admin:online:list')")
|
||||
public Result<TableDataInfo<OnlineUser>> list(
|
||||
@ApiParam(name="place",value="登录地点") String place,
|
||||
@ApiParam(name="username",value="登录名称") String username){
|
||||
TableDataInfo<OnlineUser> tableDataInfo = onlineUserService.searchList(place, username);
|
||||
return Result.ok(tableDataInfo);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{tokenId}")
|
||||
@ApiOperation("强制退出用户")
|
||||
@PreAuthorize("@ss.hasPermission('admin:online:force')")
|
||||
@Log(title = "强制退出用户",businessType = BusinessType.FORCE)
|
||||
public Result<Void> force(@PathVariable String tokenId){
|
||||
if (StrUtil.isEmpty(tokenId)){
|
||||
return Result.error("必要参数为空!");
|
||||
}
|
||||
onlineUserService.force(tokenId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.PostDto;
|
||||
import cn.fateverse.admin.query.PostQuery;
|
||||
import cn.fateverse.admin.service.PostService;
|
||||
import cn.fateverse.admin.vo.PostVo;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
|
||||
@Api(tags = "岗位管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/post")
|
||||
public class PostController {
|
||||
|
||||
|
||||
private final PostService postService;
|
||||
|
||||
|
||||
public PostController(PostService postService) {
|
||||
this.postService = postService;
|
||||
}
|
||||
|
||||
@ApiOperation("查询岗位列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dict:list')")
|
||||
public Result<TableDataInfo<PostVo>> list(PostQuery query) {
|
||||
TableDataInfo<PostVo> dataTable = postService.searchList(query);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询岗位列表")
|
||||
@GetMapping("/info/{postId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:dict:info')")
|
||||
public Result<PostVo> info(@PathVariable Long postId) {
|
||||
checkPostId(postId);
|
||||
PostVo post = postService.searchById(postId);
|
||||
return Result.ok(post);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取select下拉框数据")
|
||||
@GetMapping("/option")
|
||||
public Result<List<Option>> option() {
|
||||
List<Option> optionList = postService.searchOption();
|
||||
return Result.ok(optionList);
|
||||
}
|
||||
|
||||
@ApiOperation("新增岗位")
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dict:add')")
|
||||
@Log(title = "新增岗位", businessType = BusinessType.INSERT)
|
||||
public Result<Void> add(@RequestBody @Validated PostDto postDto) {
|
||||
postService.save(postDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("编辑岗位")
|
||||
@PutMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:dict:edit')")
|
||||
@Log(title = "编辑岗位", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> edit(@RequestBody @Validated PostDto postDto) {
|
||||
checkPostId(postDto.getPostId());
|
||||
postService.edit(postDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除岗位")
|
||||
@DeleteMapping("/{postId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:dict:del')")
|
||||
@Log(title = "删除岗位", businessType = BusinessType.DELETE)
|
||||
public Result<Void> del(@PathVariable Long postId) {
|
||||
checkPostId(postId);
|
||||
postService.removeById(postId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
private void checkPostId(Long postId) {
|
||||
if (LongUtils.isNull(postId)) {
|
||||
throw new CustomException("id不能为空!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.RoleDto;
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import cn.fateverse.admin.entity.User;
|
||||
import cn.fateverse.admin.query.RoleQuery;
|
||||
import cn.fateverse.admin.vo.RoleVo;
|
||||
import cn.fateverse.common.core.entity.IdWrapper;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.fateverse.admin.service.MenuService;
|
||||
import cn.fateverse.admin.service.RoleService;
|
||||
import cn.fateverse.admin.service.UserService;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.core.utils.ObjectUtils;
|
||||
import cn.fateverse.common.security.entity.LoginUser;
|
||||
import cn.fateverse.common.security.service.TokenService;
|
||||
import cn.fateverse.common.security.utils.SecurityUtils;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/4
|
||||
*/
|
||||
@Api(tags = "角色管理")
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
|
||||
|
||||
private final RoleService roleService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final MenuService menuService;
|
||||
|
||||
private final TokenService tokenService;
|
||||
|
||||
public RoleController(RoleService roleService, UserService userService, MenuService menuService, TokenService tokenService) {
|
||||
this.roleService = roleService;
|
||||
this.userService = userService;
|
||||
this.menuService = menuService;
|
||||
this.tokenService = tokenService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取角色列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:list')")
|
||||
public Result<TableDataInfo<RoleVo>> list(RoleQuery query) {
|
||||
TableDataInfo<RoleVo> dataInfo = roleService.searchList(query);
|
||||
return Result.ok(dataInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询角色信息")
|
||||
@GetMapping("/{roleId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:info')")
|
||||
public Result<RoleVo> info(@PathVariable Long roleId) {
|
||||
checkRoleId(roleId);
|
||||
RoleVo vo = roleService.searchById(roleId);
|
||||
return Result.ok(vo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据菜单id获取角色列表")
|
||||
@GetMapping("/menu/list")
|
||||
public Result<TableDataInfo<RoleVo>> roleExcludeMenuId(Long menuId, String roleName, String roleKey) {
|
||||
if (ObjectUtils.isEmpty(menuId)) {
|
||||
return Result.error("菜单id不能为空!");
|
||||
}
|
||||
TableDataInfo<RoleVo> dataInfo = roleService.searchListExcludeMenuId(menuId, roleName, roleKey);
|
||||
return Result.ok(dataInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据菜单id获取分配的角色信息")
|
||||
@GetMapping("/menu")
|
||||
public Result<TableDataInfo<RoleVo>> menuRole(Long menuId, String roleName, String roleKey) {
|
||||
if (ObjectUtils.isEmpty(menuId)) {
|
||||
return Result.error("菜单id不能为空!");
|
||||
}
|
||||
TableDataInfo<RoleVo> dataInfo = roleService.searchListByMenuId(menuId, roleName, roleKey);
|
||||
return Result.ok(dataInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("建立角色菜单绑定关系")
|
||||
@PutMapping("/bind/menu")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:bindMenu')")
|
||||
@Log(title = "建立角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> bindRole(@RequestBody IdWrapper wrapper) {
|
||||
checkRoleIds(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "菜单id不能为空");
|
||||
roleService.bindMenu(wrapper.getId(), wrapper.getIds());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("解除角色与菜单之间的绑定状态")
|
||||
@PutMapping("/unbind/menu")
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:unBindMenu')")
|
||||
@Log(title = "解除角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindMenu(@RequestBody IdWrapper wrapper) {
|
||||
checkRoleIds(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "菜单id不能为空");
|
||||
roleService.unBindMenu(wrapper.getId(), wrapper.getIds());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解除当前角色对应的所有菜单的绑定关系")
|
||||
@PutMapping("/all/unbind/menu")
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:unBindMenu')")
|
||||
@Log(title = "解除当前角色对应的所有用户的绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindAllMenu(@RequestBody IdWrapper wrapper) {
|
||||
LongUtils.checkId(wrapper.getId(), "菜单id不能为空");
|
||||
roleService.unBindAllMenu(wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询角色信息")
|
||||
@GetMapping("/option")
|
||||
public Result<List<Option>> option() {
|
||||
List<Option> option = roleService.searchOption();
|
||||
return Result.ok(option);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增角色")
|
||||
@PostMapping
|
||||
@Log(title = "新增角色", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:add')")
|
||||
public Result<Void> add(@RequestBody @Validated RoleDto role) {
|
||||
checkNameAndKey(role);
|
||||
roleService.save(role);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色")
|
||||
@PutMapping
|
||||
@Log(title = "修改角色", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:edit')")
|
||||
public Result<Void> edit(@NotNull @RequestBody @Validated RoleDto role) {
|
||||
checkRoleId(role.getRoleId());
|
||||
checkNameAndKey(role);
|
||||
roleService.edit(role);
|
||||
checkUserRoleUpdate(role);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色状态")
|
||||
@PutMapping("/state")
|
||||
@Log(title = "修改角色状态", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:edit')")
|
||||
public Result<Void> state(@RequestBody RoleDto role) {
|
||||
if (LongUtils.isNull(role.getRoleId())) {
|
||||
return Result.error("角色id不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(role.getState())) {
|
||||
return Result.error("状态不能为空!");
|
||||
}
|
||||
roleService.editState(role.getRoleId(), role.getState());
|
||||
checkUserRoleUpdate(role);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除角色")
|
||||
@DeleteMapping("/{roleId}")
|
||||
@Log(title = "删除角色", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:role:del')")
|
||||
public Result<Void> delete(@PathVariable Long roleId) {
|
||||
checkRoleId(roleId);
|
||||
roleService.remove(roleId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
private void checkRoleIds(List<Long> roleIds) {
|
||||
if (roleIds == null || roleIds.isEmpty()) {
|
||||
throw new CustomException("角色id不能为空!");
|
||||
}
|
||||
long count = roleIds.stream().filter(roleId -> !ObjectUtils.isEmpty(roleId)).count();
|
||||
if (count == 0) {
|
||||
throw new CustomException("角色id不能为空!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查角色id
|
||||
*/
|
||||
private void checkRoleId(Long roleId) {
|
||||
if (LongUtils.isNull(roleId)) {
|
||||
throw new CustomException("id不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查角色名称和角色关键词
|
||||
*/
|
||||
private void checkNameAndKey(RoleDto dto) {
|
||||
if (roleService.checkNameUnique(dto)) {
|
||||
throw new CustomException("角色名称已存在!");
|
||||
}
|
||||
if (roleService.checkRoleKeyUnique(dto)) {
|
||||
throw new CustomException("角色权限名称已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void checkUserRoleUpdate(RoleDto role) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtils.isEmpty(loginUser) || loginUser.getUser().isAdmin()) {
|
||||
return;
|
||||
}
|
||||
List<Role> roles = loginUser.getUser().getRoles();
|
||||
boolean checked = roles.stream().anyMatch(info -> info.getRoleId().equals(role.getRoleId()));
|
||||
if (!checked) {
|
||||
return;
|
||||
}
|
||||
User user = userService.searchByUserName(loginUser.getUser().getUserName());
|
||||
Set<String> permsSet = menuService.searchPermsByUserId(user.getUserId());
|
||||
loginUser.setUser(user);
|
||||
loginUser.setPermissions(permsSet);
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
package cn.fateverse.admin.controller;
|
||||
|
||||
import cn.fateverse.admin.dto.UserDto;
|
||||
import cn.fateverse.admin.query.UserQuery;
|
||||
import cn.fateverse.admin.vo.UserChooseVo;
|
||||
import cn.fateverse.admin.vo.UserDetailVo;
|
||||
import cn.fateverse.admin.vo.UserVo;
|
||||
import cn.fateverse.common.core.entity.IdWrapper;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.fateverse.admin.service.PostService;
|
||||
import cn.fateverse.admin.service.RoleService;
|
||||
import cn.fateverse.admin.service.UserService;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
import cn.fateverse.common.core.utils.LongUtils;
|
||||
import cn.fateverse.common.security.annotation.Anonymity;
|
||||
import cn.fateverse.common.log.annotation.Log;
|
||||
import cn.fateverse.common.log.enums.BusinessType;
|
||||
import cn.fateverse.common.mybatis.utils.PageUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/29
|
||||
*/
|
||||
@Api(tags = "用户管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final RoleService roleService;
|
||||
|
||||
private final PostService postService;
|
||||
|
||||
public UserController(UserService userService,
|
||||
RoleService roleService,
|
||||
PostService postService) {
|
||||
this.userService = userService;
|
||||
this.roleService = roleService;
|
||||
this.postService = postService;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:list')")
|
||||
public Result<TableDataInfo<UserVo>> list(UserQuery userQuery) {
|
||||
PageUtils.startPage();
|
||||
List<UserVo> userVos = userService.searchList(userQuery);
|
||||
TableDataInfo<UserVo> dataTable = PageUtils.getDataTable(userVos);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
@ApiOperation("根据角色或者部门获取到对应的数据")
|
||||
@GetMapping("/choose/{type}/{chooseId}")
|
||||
@Anonymity
|
||||
public Result<List<UserChooseVo>> choose(@PathVariable Integer type, @PathVariable Long chooseId) {
|
||||
if (null == type || null == chooseId || type > 1 || type < 0) {
|
||||
return Result.error("参数异常!");
|
||||
}
|
||||
List<UserChooseVo> userChooseList = userService.searchUserChooseRoleOrDept(type, chooseId);
|
||||
return Result.ok(userChooseList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping("/info/{userId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:info')")
|
||||
public Result<UserDetailVo> info(@PathVariable Long userId) {
|
||||
checkUserId(userId);
|
||||
UserDetailVo userDetail = userService.searchByUserId(userId);
|
||||
List<Option> roleOption = roleService.searchOption();
|
||||
List<Option> postOption = postService.searchOption();
|
||||
userDetail.setRoleList(roleOption);
|
||||
userDetail.setPostList(postOption);
|
||||
return Result.ok(userDetail);
|
||||
}
|
||||
|
||||
@ApiOperation("根据角色id获取用户信息")
|
||||
@GetMapping("/role/{roleId}")
|
||||
public Result<TableDataInfo<UserVo>> role(@PathVariable Long roleId, String userName, String phoneNumber) {
|
||||
LongUtils.checkId(roleId, "角色id不能为空!");
|
||||
PageUtils.startPage();
|
||||
List<UserVo> userList = userService.searchListByRoleId(roleId, userName, phoneNumber);
|
||||
TableDataInfo<UserVo> dataTable = PageUtils.getDataTable(userList);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
@ApiOperation("排除角色id获取用户信息")
|
||||
@GetMapping("/role/exclude/{roleId}")
|
||||
public Result<TableDataInfo<UserVo>> excludeRole(@PathVariable Long roleId, String userName, String phoneNumber) {
|
||||
LongUtils.checkId(roleId, "角色id不能为空!");
|
||||
TableDataInfo<UserVo> table = userService.searchUserListByExcludeRoleId(roleId, userName, phoneNumber);
|
||||
return Result.ok(table);
|
||||
}
|
||||
|
||||
@ApiOperation("建立角色用户绑定关系")
|
||||
@PutMapping("/bind/role")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:bindRole')")
|
||||
@Log(title = "建立角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> bindRole(@RequestBody IdWrapper wrapper) {
|
||||
checkUserId(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "角色id不能为空");
|
||||
userService.bindRole(wrapper.getIds(), wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解除角色与用户之间的绑定状态")
|
||||
@PutMapping("/unbind/role")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:unBindRole')")
|
||||
@Log(title = "解除角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindRole(@RequestBody IdWrapper wrapper) {
|
||||
checkUserId(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "角色id不能为空");
|
||||
userService.unBindRole(wrapper.getIds(), wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解除当前角色对应的所有用户的绑定关系")
|
||||
@PutMapping("/all/unbind/role")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:unBindRole')")
|
||||
@Log(title = "解除当前角色对应的所有用户的绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindAllRole(@RequestBody IdWrapper wrapper) {
|
||||
LongUtils.checkId(wrapper.getId(), "角色id不能为空");
|
||||
userService.unBindAllRole(wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
// @ApiOperation("根据角色id获取用户信息")
|
||||
// @GetMapping("/dept/{roleId}")
|
||||
public Result<TableDataInfo<UserVo>> dept(@PathVariable Long deptId, String userName, String phoneNumber) {
|
||||
LongUtils.checkId(deptId, "角色id不能为空!");
|
||||
PageUtils.startPage();
|
||||
List<UserVo> userList = userService.searchListByDeptId(deptId, userName, phoneNumber);
|
||||
TableDataInfo<UserVo> dataTable = PageUtils.getDataTable(userList);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
// @ApiOperation("排除角色id获取用户信息")
|
||||
// @GetMapping("/dept/exclude/{deptId}")
|
||||
public Result<TableDataInfo<UserVo>> excludeDept(@PathVariable Long deptId, String userName, String phoneNumber) {
|
||||
LongUtils.checkId(deptId, "角色id不能为空!");
|
||||
TableDataInfo<UserVo> table = userService.searchUserListByExcludeDeptId(deptId, userName, phoneNumber);
|
||||
return Result.ok(table);
|
||||
}
|
||||
|
||||
// @ApiOperation("解除角色与用户之间的绑定状态")
|
||||
// @PutMapping("/unbind/{userIds}/dept/{deptId}")
|
||||
// @PreAuthorize("@ss.hasPermission('admin:user:unBindRole')")
|
||||
// @Log(title = "解除角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindDept(@PathVariable List<Long> userIds, @PathVariable Long deptId) {
|
||||
checkUserId(userIds);
|
||||
LongUtils.checkId(deptId, "角色id不能为空");
|
||||
userService.unBindDept(userIds, deptId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
// @ApiOperation("解除当前角色对应的所有用户的绑定关系")
|
||||
// @PutMapping("/unbind/dept/{deptId}")
|
||||
// @PreAuthorize("@ss.hasPermission('admin:user:unBindRole')")
|
||||
// @Log(title = "解除当前角色对应的所有用户的绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindAllDept(@PathVariable Long deptId) {
|
||||
LongUtils.checkId(deptId, "角色id不能为空");
|
||||
userService.unBindAllDept(deptId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("根据岗位id获取用户信息")
|
||||
@GetMapping("/post/{postId}")
|
||||
public Result<TableDataInfo<UserVo>> post(@PathVariable Long postId, String userName, String phoneNumber) {
|
||||
if (LongUtils.isNull(postId)) {
|
||||
return Result.error("岗位id不能为空!");
|
||||
}
|
||||
PageUtils.startPage();
|
||||
List<UserVo> userList = userService.searchListByPostId(postId, userName, phoneNumber);
|
||||
TableDataInfo<UserVo> dataTable = PageUtils.getDataTable(userList);
|
||||
return Result.ok(dataTable);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("排除岗位id获取用户信息")
|
||||
@GetMapping("/post/exclude/{postId}")
|
||||
public Result<TableDataInfo<UserVo>> excludePost(@PathVariable Long postId, String userName, String phoneNumber) {
|
||||
LongUtils.checkId(postId, "角色id不能为空!");
|
||||
TableDataInfo<UserVo> table = userService.searchUserListByExcludePostId(postId, userName, phoneNumber);
|
||||
return Result.ok(table);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("建立角色用户绑定关系")
|
||||
@PutMapping("/bind/post")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:bindPost')")
|
||||
@Log(title = "建立角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> bindPost(@RequestBody IdWrapper wrapper) {
|
||||
checkUserId(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "角色id不能为空");
|
||||
userService.bindPost(wrapper.getIds(), wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解除岗位与用户之间的绑定状态")
|
||||
@PutMapping("/unbind/post")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:unbindPost')")
|
||||
@Log(title = "解除角色用户绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindPost(@RequestBody IdWrapper wrapper) {
|
||||
checkUserId(wrapper.getIds());
|
||||
LongUtils.checkId(wrapper.getId(), "岗位id不能为空");
|
||||
userService.unBindPost(wrapper.getIds(), wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解除当前岗位对应的所有用户的绑定关系")
|
||||
@PutMapping("/all/unbind/post")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:unbindPost')")
|
||||
@Log(title = "解除当前角色对应的所有用户的绑定关系", businessType = BusinessType.UPDATE)
|
||||
public Result<Void> unBindAllPost(@RequestBody IdWrapper wrapper) {
|
||||
LongUtils.checkId(wrapper.getId(), "岗位id不能为空");
|
||||
userService.unBindAllPost(wrapper.getId());
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping
|
||||
@Log(title = "新增用户", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:add')")
|
||||
public Result<Void> add(@NotNull @RequestBody @Validated UserDto user) {
|
||||
if (StrUtil.isEmpty(user.getPassword())) {
|
||||
return Result.error("初始密码不能为空");
|
||||
}
|
||||
checkPhone(user.getPhoneNumber());
|
||||
userService.save(user);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("修改用户")
|
||||
@PutMapping
|
||||
@Log(title = "修改用户", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:edit')")
|
||||
public Result<Void> edit(@NotNull @RequestBody @Validated UserDto user) {
|
||||
checkUserId(user.getUserId());
|
||||
checkPhone(user.getPhoneNumber());
|
||||
userService.edit(user);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户")
|
||||
@DeleteMapping("/{userId}")
|
||||
@PreAuthorize("@ss.hasPermission('admin:user:del')")
|
||||
@Log(title = "删除用户", businessType = BusinessType.DELETE)
|
||||
public Result<Void> del(@PathVariable Long userId) {
|
||||
checkUserId(userId);
|
||||
userService.remove(userId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户id是都为空
|
||||
*/
|
||||
private void checkUserId(List<Long> userIds) {
|
||||
if (userIds == null || userIds.isEmpty()) {
|
||||
throw new CustomException("用户id不能为空!");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkUserId(Long userId) {
|
||||
if (LongUtils.isNull(userId)) {
|
||||
throw new CustomException("用户id不能为空!");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkPhone(String phone) {
|
||||
if (!StrUtil.isEmpty(phone) && !Pattern.matches("^1[0-9]{10}$", phone)) {
|
||||
throw new CustomException("手机号格式错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.fateverse.admin.controller.test;
|
||||
|
||||
import cn.fateverse.common.security.annotation.Anonymity;
|
||||
import cn.fateverse.common.security.annotation.MappingSwitch;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 15:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class TestController {
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping
|
||||
public String test() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test1")
|
||||
public String test1() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test2")
|
||||
public String test2() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test3")
|
||||
public String test3() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test4")
|
||||
public String test4() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@PostMapping("/test5")
|
||||
public String test5() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@PutMapping("/test6")
|
||||
public String test6() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@DeleteMapping("/test7")
|
||||
public String test7() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.fateverse.admin.controller.test;
|
||||
|
||||
import cn.fateverse.common.security.annotation.Anonymity;
|
||||
import cn.fateverse.common.security.annotation.MappingSwitch;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 15:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test1")
|
||||
public class TestController1 {
|
||||
|
||||
|
||||
@MappingSwitch("测试开关")
|
||||
@Anonymity
|
||||
@GetMapping
|
||||
public String test() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test1")
|
||||
public String test1() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test2")
|
||||
public String test2() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test3")
|
||||
public String test3() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@GetMapping("/test4")
|
||||
public String test4() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@PostMapping("/test5")
|
||||
public String test5() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@PutMapping("/test6")
|
||||
public String test6() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
@MappingSwitch
|
||||
@Anonymity
|
||||
@DeleteMapping("/test7")
|
||||
public String test7() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.fateverse.admin.controller.test;
|
||||
|
||||
import cn.fateverse.common.security.annotation.Anonymity;
|
||||
import cn.fateverse.common.security.annotation.MappingSwitch;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 15:03
|
||||
*/
|
||||
@MappingSwitch("测试类开关")
|
||||
@RestController
|
||||
@RequestMapping("/test2")
|
||||
public class TestController2 {
|
||||
|
||||
|
||||
@Anonymity
|
||||
@GetMapping
|
||||
public String test() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.service.DeptService;
|
||||
import cn.fateverse.admin.vo.DeptVo;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@DubboService
|
||||
public class DubboDeptServiceImpl implements DubboDeptService {
|
||||
|
||||
|
||||
private final DeptService deptService;
|
||||
|
||||
public DubboDeptServiceImpl(DeptService deptService) {
|
||||
this.deptService = deptService;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DeptVo> searchDeptByDeptId(List<Long> deptIds) {
|
||||
return deptService.searchByIds(deptIds);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.service.DictDataService;
|
||||
import cn.fateverse.admin.vo.DictDataVo;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@DubboService
|
||||
public class DubboDictDataServiceImpl implements DubboDictDataService {
|
||||
|
||||
private final DictDataService dictDataService;
|
||||
|
||||
public DubboDictDataServiceImpl(DictDataService dictDataService) {
|
||||
this.dictDataService = dictDataService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Map<String, DictDataVo>> searchDictDataCacheKeys(List<String> cacheKeys) {
|
||||
return dictDataService.searchCacheKeys(cacheKeys);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.dto.MenuDto;
|
||||
import cn.fateverse.admin.service.MenuService;
|
||||
import cn.fateverse.admin.vo.MenuVo;
|
||||
import cn.fateverse.admin.vo.RouterVo;
|
||||
import cn.fateverse.common.core.result.Result;
|
||||
import cn.fateverse.common.core.utils.MenuTypeUtils;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@DubboService
|
||||
public class DubboMenuServiceImpl implements DubboMenuService {
|
||||
|
||||
|
||||
private final MenuService menuService;
|
||||
|
||||
public DubboMenuServiceImpl(MenuService menuService) {
|
||||
this.menuService = menuService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> selectMenuPermsByUserId(Long userId) {
|
||||
return menuService.searchPermsByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RouterVo> selectMenuRouterByUserId(Long userId) {
|
||||
return menuService.searchRouterByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<Long> insertMenu(MenuDto menuDto) {
|
||||
if (MenuTypeUtils.checkMenuTypeLegal(menuDto.getMenuType())) {
|
||||
return Result.error("菜单类型错误");
|
||||
}
|
||||
menuService.saveRPC(menuDto);
|
||||
return Result.ok(menuDto.getMenuId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMenu(Long menuId) {
|
||||
menuService.removeMenu(menuId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<MenuVo> selectMenuByMenuId(Long menuId) {
|
||||
MenuVo menu = menuService.searchByMenuId(menuId);
|
||||
return Result.ok(menu);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import cn.fateverse.admin.mapper.RoleMapper;
|
||||
import cn.fateverse.admin.query.RoleQuery;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-05-06
|
||||
*/
|
||||
@DubboService
|
||||
public class DubboRoleServiceImpl implements DubboRoleService {
|
||||
|
||||
|
||||
private final RoleMapper roleMapper;
|
||||
|
||||
public DubboRoleServiceImpl(RoleMapper roleMapper) {
|
||||
this.roleMapper = roleMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> searchRoleNameByIds(List<Long> roleIds) {
|
||||
RoleQuery query = new RoleQuery();
|
||||
query.setState("0");
|
||||
List<Role> roleList = roleMapper.selectByIds(roleIds);
|
||||
if (null == roleList||roleList.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return roleList.stream().map(Role::getRoleName).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.fateverse.admin.dubbo;
|
||||
|
||||
import cn.fateverse.admin.entity.User;
|
||||
import cn.fateverse.admin.service.UserService;
|
||||
import cn.fateverse.admin.vo.UserVo;
|
||||
import cn.fateverse.common.core.exception.CustomException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@DubboService
|
||||
public class DubboUserServiceImpl implements DubboUserService {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
public DubboUserServiceImpl(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public User getUserByUsername(String username) {
|
||||
log.info("用户登录:{}", username);
|
||||
return userService.searchByUserName(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getUserByUserId(Long userId) {
|
||||
return userService.searchUserInfoByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVo> searchUserListByRoleIds(List<Long> roleIds) {
|
||||
if (roleIds.isEmpty()) {
|
||||
throw new CustomException("角色id不能为空");
|
||||
}
|
||||
return userService.searchListByRoleIds(roleIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVo> searchUserListByUserIds(List<Long> userIds) {
|
||||
if (userIds.isEmpty()) {
|
||||
throw new CustomException("用户id不能为空");
|
||||
}
|
||||
return userService.searchByUserIds(userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVo> searchUserByDeptIds(List<Long> deptIds) {
|
||||
if (deptIds.isEmpty()) {
|
||||
throw new CustomException("部门id不能为空");
|
||||
}
|
||||
return userService.searchByDeptIds(deptIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> searchAllUserIds() {
|
||||
return userService.searchAllUserIds();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package cn.fateverse.admin.entity.vo;
|
||||
|
||||
import cn.fateverse.common.decrypt.annotation.EncryptField;
|
||||
import cn.fateverse.common.security.entity.MappingSwitchInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2024/2/5 14:23
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("接口开关返回对象")
|
||||
public class MappingSwitchVo {
|
||||
|
||||
|
||||
/**
|
||||
* key作为唯一编号
|
||||
*/
|
||||
@EncryptField
|
||||
@ApiModelProperty("key作为唯一编号")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 应用名称
|
||||
*/
|
||||
@ApiModelProperty("应用名称")
|
||||
private String applicationName;
|
||||
|
||||
/**
|
||||
* 类名
|
||||
*/
|
||||
@ApiModelProperty("类名")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 方法名称
|
||||
*/
|
||||
@ApiModelProperty("方法名称")
|
||||
private String methodName;
|
||||
|
||||
/**
|
||||
* 描述MappingSwitch注解的value可以为空
|
||||
*/
|
||||
@ApiModelProperty("描述MappingSwitch注解的value可以为空")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* HandlerMethod中的uri
|
||||
*/
|
||||
@ApiModelProperty("HandlerMethod中的uri")
|
||||
private Set<String> uris;
|
||||
|
||||
/**
|
||||
* 当前开关类型
|
||||
*/
|
||||
@ApiModelProperty("当前开关类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 当前方法请求类型
|
||||
*/
|
||||
@ApiModelProperty("当前方法请求类型")
|
||||
private Set<String> httpMethods;
|
||||
|
||||
/**
|
||||
* 当前方法的状态,true为正常放行,false为关闭
|
||||
*/
|
||||
@ApiModelProperty("当前方法的状态,true为正常放行,false为关闭")
|
||||
private Boolean state;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@ApiModelProperty("变更时间")
|
||||
private Date operTime;
|
||||
/**
|
||||
* 操作人员
|
||||
*/
|
||||
@ApiModelProperty("操作人员")
|
||||
private String operName;
|
||||
|
||||
public static MappingSwitchVo toMappingSwitchVo(MappingSwitchInfo mappingSwitchInfo) {
|
||||
return MappingSwitchVo.builder()
|
||||
.key(mappingSwitchInfo.getKey())
|
||||
.applicationName(mappingSwitchInfo.getApplicationName())
|
||||
.className(mappingSwitchInfo.getClassName())
|
||||
.description(mappingSwitchInfo.getDescription())
|
||||
.methodName(mappingSwitchInfo.getMethodName())
|
||||
.uris(mappingSwitchInfo.getUris())
|
||||
.type(mappingSwitchInfo.getType().toString())
|
||||
.httpMethods(mappingSwitchInfo.getHttpMethods())
|
||||
.state(mappingSwitchInfo.getState())
|
||||
.operName(mappingSwitchInfo.getOperName())
|
||||
.operTime(mappingSwitchInfo.getOperTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.query.ConfigQuery;
|
||||
import cn.fateverse.admin.entity.Config;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置表 Mapper
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
public interface ConfigMapper {
|
||||
|
||||
/**
|
||||
* 查询参数配置表
|
||||
*
|
||||
* @param configId 参数配置表Id
|
||||
* @return 参数配置表
|
||||
*/
|
||||
Config selectById(Integer configId);
|
||||
|
||||
/**
|
||||
* 查询参数配置表列表
|
||||
*
|
||||
* @param query 参数配置表查询
|
||||
* @return 参数配置表集合
|
||||
*/
|
||||
List<Config> selectListPage(@Param("query") ConfigQuery query, @Param("start") Integer start, @Param("size") Integer size);
|
||||
|
||||
|
||||
Long selectCount(@Param("query") ConfigQuery query);
|
||||
|
||||
List<Config> selectList(ConfigQuery query);
|
||||
|
||||
/**
|
||||
* 新增参数配置表
|
||||
*
|
||||
* @param config 参数配置表
|
||||
* @return 结果
|
||||
*/
|
||||
int insert(Config config);
|
||||
|
||||
/**
|
||||
* 修改参数配置表
|
||||
*
|
||||
* @param config 参数配置表
|
||||
* @return 结果
|
||||
*/
|
||||
int update(Config config);
|
||||
|
||||
/**
|
||||
* 删除参数配置表
|
||||
*
|
||||
* @param configId 需要删除的参数配置表Id
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteById(Integer configId);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置表
|
||||
*
|
||||
* @param configIdList 需要删除的参数配置表Id 集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBatchByIdList(List<Integer> configIdList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.Dept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
public interface DeptMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门列表
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param state 部门状态
|
||||
* @return 部门集合
|
||||
*/
|
||||
List<Dept> selectList(@Param("deptName") String deptName, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 通过id查询部门信息
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 返回对象
|
||||
*/
|
||||
Dept selectById(Long deptId);
|
||||
|
||||
/**
|
||||
* 获取排除自身的部门列表
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 部门集合
|
||||
*/
|
||||
List<Dept> selectExclude(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询所有的子节点
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 部门集合
|
||||
*/
|
||||
List<Dept> selectChildrenById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
Dept selectByDeptNameAndParentId(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 根据父id查询部门信息
|
||||
* @param parentId 父级部门id
|
||||
* @return 部门集合
|
||||
*/
|
||||
List<Dept> selectListByDeptParentId(Long parentId);
|
||||
|
||||
|
||||
/**
|
||||
* 通过parentId查询子列表
|
||||
*
|
||||
* @param parentId 父级id
|
||||
* @return 部门名称集合
|
||||
*/
|
||||
Set<String> selectDeptNameListByParentId(Long parentId);
|
||||
|
||||
/**
|
||||
* 查找是否存在子节点
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 数量
|
||||
*/
|
||||
int selectChildCountByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 数量
|
||||
*/
|
||||
int selectExistUserCount(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ids获取到部门
|
||||
*
|
||||
* @param deptIds 部门id列表
|
||||
* @return 部门集合对象
|
||||
*/
|
||||
List<Dept> selectByIds(List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 影响条数
|
||||
*/
|
||||
int insert(Dept dept);
|
||||
|
||||
/**
|
||||
* 更新部门信息
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 影响条数
|
||||
*/
|
||||
int update(Dept dept);
|
||||
|
||||
/**
|
||||
* 修改部门的状态;
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 影响条数
|
||||
*/
|
||||
int updateState(Dept dept);
|
||||
|
||||
/**
|
||||
* 批量修改子元素之前的关系
|
||||
*
|
||||
* @param depts 子元素
|
||||
* @return 结果
|
||||
*/
|
||||
int updateChildren(@Param("depts") List<Dept> depts);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 运行结构
|
||||
*/
|
||||
int delete(Long deptId);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.query.DictDataQuery;
|
||||
import cn.fateverse.admin.entity.DictData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface DictDataMapper {
|
||||
/**
|
||||
* 查询字典信息
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<DictData> selectList(DictDataQuery query);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询数据
|
||||
*
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
List<DictData> selectByType(String dictType);
|
||||
|
||||
/**
|
||||
* 查询字典数据需要缓存的列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DictData> selectCacheList();
|
||||
|
||||
/**
|
||||
* 根据code查询字典数据
|
||||
*
|
||||
* @param dictCode
|
||||
* @return
|
||||
*/
|
||||
DictData selectByCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 通过类型查询下方的数据量
|
||||
*
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
int selectCountByType(String dictType);
|
||||
|
||||
/**
|
||||
* 新增字典数据
|
||||
*
|
||||
* @param dictData
|
||||
* @return
|
||||
*/
|
||||
int insert(DictData dictData);
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
*
|
||||
* @param dictData
|
||||
* @return
|
||||
*/
|
||||
int update(DictData dictData);
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
*
|
||||
* @param dictCode
|
||||
* @return
|
||||
*/
|
||||
int deleteByCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
* @param dictCodeList
|
||||
* @return
|
||||
*/
|
||||
int deleteBatch(List<Long> dictCodeList);
|
||||
|
||||
/**
|
||||
* 更新DictData的dictType
|
||||
*
|
||||
* @param dictType
|
||||
* @param newDictType
|
||||
* @return
|
||||
*/
|
||||
int updateByDictType(@Param("dictType") String dictType, @Param("newDictType") String newDictType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.query.DictTypeQuery;
|
||||
import cn.fateverse.admin.entity.DictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface DictTypeMapper {
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<DictType> selectList(DictTypeQuery query);
|
||||
|
||||
/**
|
||||
* 通过字典类型id查询字典信息
|
||||
*
|
||||
* @param dictId
|
||||
* @return
|
||||
*/
|
||||
DictType selectByDictId(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据dictType查询字典类型
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
DictType selectByDictType(String dictType);
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
int insert(DictType dictType);
|
||||
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
int update(DictType dictType);
|
||||
|
||||
/**
|
||||
* 删除字典信息
|
||||
*
|
||||
* @param dictId
|
||||
* @return
|
||||
*/
|
||||
int deleteById(Long dictId);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.IpBack;
|
||||
import cn.fateverse.admin.query.IpBackQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
public interface IpBackMapper {
|
||||
|
||||
/**
|
||||
* 查询ip黑名单列表
|
||||
*
|
||||
* @param query 查询对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<IpBack> selectList(IpBackQuery query);
|
||||
|
||||
IpBack selectByIdaddr(String ipAddr);
|
||||
|
||||
IpBack selectIpv4Count();
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id id
|
||||
* @return ip黑名单
|
||||
*/
|
||||
IpBack selectById(Long id);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param ids id
|
||||
* @return ip黑名单
|
||||
*/
|
||||
List<IpBack> selectByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param ipBack ip黑名单
|
||||
* @return 执行结果
|
||||
*/
|
||||
int insert(IpBack ipBack);
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param ipBack ip黑名单
|
||||
* @return 执行结果
|
||||
*/
|
||||
int update(IpBack ipBack);
|
||||
|
||||
/**
|
||||
* 删除ip
|
||||
*
|
||||
* @param ids ip列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(List<Long> ids);
|
||||
|
||||
List<IpBack> selectListStartEnd(@Param("start") int start, @Param("end") int end);
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
|
||||
import cn.fateverse.admin.entity.Menu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
public interface MenuMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询菜单列表
|
||||
*
|
||||
* @param menuName
|
||||
* @param state
|
||||
* @param excludeId
|
||||
* @param button
|
||||
* @return
|
||||
*/
|
||||
List<Menu> selectList(@Param("menuName") String menuName,
|
||||
@Param("state") String state,
|
||||
@Param("excludeId") Long excludeId,
|
||||
@Param("button") Boolean button);
|
||||
|
||||
/**
|
||||
* 根据用户id获取到用户的菜单信息
|
||||
*
|
||||
* @param userId
|
||||
* @param excludeId
|
||||
* @return
|
||||
*/
|
||||
List<Menu> selectListByUserId(@Param("userId") Long userId,
|
||||
@Param("menuName") String menuName,
|
||||
@Param("state") String state,
|
||||
@Param("excludeId") Long excludeId,
|
||||
@Param("button") Boolean button);
|
||||
|
||||
/**
|
||||
* 通过id查询菜单详细信息
|
||||
*
|
||||
* @param menuId
|
||||
* @return
|
||||
*/
|
||||
Menu selectById(Long menuId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
Set<String> selectMenuPermsByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取当前角色拥有的菜单权限
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
Set<Long> selectCheckedMenuIdByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据用户id查询当前用户拥有的菜单权限集合
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Set<Long> selectCheckedMenuIdByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取所有的菜单id,管理员专用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Set<Long> selectAllMenuId();
|
||||
|
||||
/**
|
||||
* 获取全部的树形结构的菜单列表(为超级管理员所放行的权限),这里获取的将是路由信息,则不现实按钮
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Menu> selectRouterMenuList();
|
||||
|
||||
/**
|
||||
* 通过用户id查询到所有用的权限,这里则获取到对应用户可以选择的option
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
List<Menu> selectRouterMenuListByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 通过用户id查询到当前用户所拥有的的权限
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<Menu> selectByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
*
|
||||
* @param menu
|
||||
* @return
|
||||
*/
|
||||
int insert(Menu menu);
|
||||
|
||||
/**
|
||||
* 更新菜单信息
|
||||
*
|
||||
* @param menu
|
||||
* @return
|
||||
*/
|
||||
int update(Menu menu);
|
||||
|
||||
/**
|
||||
* 根据id删除菜单
|
||||
*
|
||||
* @param menuId
|
||||
* @return
|
||||
*/
|
||||
int deleteById(Long menuId);
|
||||
|
||||
/**
|
||||
* 获取到子节点数量
|
||||
*
|
||||
* @param menuId 菜单id
|
||||
* @return 统计数量
|
||||
*/
|
||||
Integer selectCountByParentId(Long menuId);
|
||||
|
||||
/**
|
||||
* 通过权限字符查询到菜单信息
|
||||
*
|
||||
* @param perms 权限字符
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<Menu> selectByPerms(String perms);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.query.PostQuery;
|
||||
import cn.fateverse.admin.entity.Post;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
public interface PostMapper {
|
||||
|
||||
/**
|
||||
* 查询岗位列表
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<Post> selectList(PostQuery query);
|
||||
|
||||
/**
|
||||
* 根据id查询岗位信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Post selectById(Long id);
|
||||
|
||||
/**
|
||||
* 根据岗位code查询岗位信息
|
||||
*
|
||||
* @param postCode
|
||||
* @return
|
||||
*/
|
||||
Post selectByPostCode(String postCode);
|
||||
|
||||
/**
|
||||
* 根据岗位名称查询岗位信息
|
||||
*
|
||||
* @param postName
|
||||
* @return
|
||||
*/
|
||||
Post selectByPostName(String postName);
|
||||
|
||||
/**
|
||||
* 查询当前岗位下有多少用户
|
||||
*
|
||||
* @param postId
|
||||
* @return
|
||||
*/
|
||||
int hasUserByPostId(Long postId);
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*
|
||||
* @param post
|
||||
* @return
|
||||
*/
|
||||
int insert(Post post);
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
*
|
||||
* @param post
|
||||
* @return
|
||||
*/
|
||||
int update(Post post);
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.Role;
|
||||
import cn.fateverse.admin.query.RoleQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/4
|
||||
*/
|
||||
public interface RoleMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<Role> selectList(RoleQuery query);
|
||||
|
||||
/**
|
||||
* 根据菜单ID搜索角色信息
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @param roleName 角色名称
|
||||
* @param roleKey 角色关键字
|
||||
* @return 角色信息列表
|
||||
*/
|
||||
List<Role> selectListByMenuId(@Param("menuId") Long menuId, @Param("roleName") String roleName, @Param("roleKey") String roleKey);
|
||||
|
||||
|
||||
/**
|
||||
* 根据菜单ID排除条件搜索角色列表
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @param roleName 角色名称
|
||||
* @param roleKey 角色关键字
|
||||
* @return 符合排除条件的角色列表
|
||||
*/
|
||||
List<Role> searchListExcludeMenuId(@Param("menuId") Long menuId, @Param("roleName") String roleName, @Param("roleKey") String roleKey);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户信息
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
Role selectById(Long roleId);
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
int insert(Role role);
|
||||
|
||||
/**
|
||||
* 更新角色
|
||||
*
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
int update(Role role);
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int delete(Long roleId);
|
||||
|
||||
/**
|
||||
* 检查当前角色下是否还拥有用户
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int hasUserByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 检查角色名称是否唯一
|
||||
*
|
||||
* @param roleName
|
||||
* @return
|
||||
*/
|
||||
Role selectByRoleName(String roleName);
|
||||
|
||||
/**
|
||||
* 检查角色权限是否唯一
|
||||
*
|
||||
* @param roleKey
|
||||
* @return
|
||||
*/
|
||||
Role selectByRoleKey(String roleKey);
|
||||
|
||||
/**
|
||||
* 根据角色id数组获取到角色信息
|
||||
*
|
||||
* @param roleIds
|
||||
* @return
|
||||
*/
|
||||
List<Role> selectByIds(List<Long> roleIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.RoleMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/6
|
||||
*/
|
||||
public interface RoleMenuMapper {
|
||||
|
||||
/**
|
||||
* 根据角色id获取到菜单列表
|
||||
*
|
||||
* @param roleId 角色id
|
||||
* @return 菜单列表
|
||||
*/
|
||||
Set<Long> selectMenuIdsByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量新增roleMenu映射关系
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int batch(List<RoleMenu> list);
|
||||
|
||||
/**
|
||||
* 根据角色id删除角色菜单映射表
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int deleteByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据菜单id删除角色菜单映射表
|
||||
*
|
||||
* @param menuId
|
||||
* @return
|
||||
*/
|
||||
int deleteByMenuId(Long menuId);
|
||||
|
||||
/**
|
||||
* 取消菜单绑定
|
||||
*
|
||||
* @param menuId 菜单id
|
||||
* @param roleIds 角色ids
|
||||
* @return 执行结果
|
||||
*/
|
||||
int unBindMenu(@Param("menuId") Long menuId, @Param("roleIds") List<Long> roleIds);
|
||||
|
||||
/**
|
||||
* 取消当前菜单绑定的所有角色信息
|
||||
*
|
||||
* @param menuId 菜单id
|
||||
* @return 执行结果
|
||||
*/
|
||||
int unBindAllMenu(Long menuId);
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.User;
|
||||
import cn.fateverse.admin.entity.UserBase;
|
||||
import cn.fateverse.admin.query.UserQuery;
|
||||
import cn.fateverse.admin.vo.UserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/10/30
|
||||
*/
|
||||
public interface UserMapper {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
User selectByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 获取所有的用户id
|
||||
*
|
||||
* @return 所有用的id
|
||||
*/
|
||||
List<Long> selectAllUserIds();
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*
|
||||
* @param query 用户查询信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<UserVo> selectList(UserQuery query);
|
||||
|
||||
/**
|
||||
* 排除角色id
|
||||
*
|
||||
* @param roleId 角色id
|
||||
* @return 表格数据信息
|
||||
*/
|
||||
List<UserVo> selectUserListByExcludeRoleId(@Param("roleId") Long roleId, @Param("userName") String userName, @Param("phoneNumber") String phoneNumber);
|
||||
|
||||
|
||||
/**
|
||||
* 根据排除的帖子ID、用户名和手机号码查询用户列表
|
||||
*
|
||||
* @param postId 排除的帖子ID
|
||||
* @param userName 用户名
|
||||
* @param phoneNumber 手机号码
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<UserVo> selectUserListByExcludePostId(@Param("postId") Long postId, @Param("userName") String userName, @Param("phoneNumber") String phoneNumber);
|
||||
|
||||
|
||||
/**
|
||||
* 根据角色id查询用户信息
|
||||
*
|
||||
* @param roleId 角色id
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<UserVo> selectUserListByRoleId(@Param("roleId") Long roleId, @Param("userName") String userName, @Param("phoneNumber") String phoneNumber);
|
||||
|
||||
|
||||
/**
|
||||
* 根据角色id list 查询用户信息
|
||||
*
|
||||
* @param roleIds 角色id列表
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<UserVo> selectUserListByRoleIds(List<Long> roleIds);
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户信息
|
||||
*
|
||||
* @param userIds 用户id列表
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<UserVo> selectUserByUserIds(List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 根据部门id列表查询用户信息
|
||||
*
|
||||
* @param deptIds 部门id列表
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<UserVo> selectUserByDeptIds(List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 根据岗位id查询用户信息
|
||||
*
|
||||
* @param postId 岗位名称
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
List<UserVo> selectUserListByPostId(@Param("postId") Long postId, @Param("userName") String userName, @Param("phoneNumber") String phoneNumber);
|
||||
|
||||
/**
|
||||
* 通过用户id查询用户信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 用户信息
|
||||
*/
|
||||
User selectUserByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 校验用户是否唯一
|
||||
*
|
||||
* @param userName 用户名称
|
||||
* @return 用户信息
|
||||
*/
|
||||
User selectUserInfoByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 校验手机号是否唯一
|
||||
*
|
||||
* @param phoneNumber 电话号码
|
||||
* @return 用户信息
|
||||
*/
|
||||
User selectByPhoneNum(String phoneNumber);
|
||||
|
||||
/**
|
||||
* 校验邮箱是否唯一
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @return 用户信息
|
||||
*/
|
||||
User selectByEmail(String email);
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insert(UserBase user);
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
int update(UserBase user);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据部门ID、用户名和手机号码搜索用户列表
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param userName 用户名
|
||||
* @param phoneNumber 手机号码
|
||||
* @return 搜索结果列表
|
||||
*/
|
||||
List<UserVo> searchListByDeptId(Long deptId, String userName, String phoneNumber);
|
||||
|
||||
/**
|
||||
* 根据部门ID、用户名和手机号码搜索排除指定部门的用户列表
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param userName 用户名
|
||||
* @param phoneNumber 手机号码
|
||||
* @return 搜索结果列表
|
||||
*/
|
||||
List<UserVo> searchUserListByExcludeDeptId(Long deptId, String userName, String phoneNumber);
|
||||
|
||||
/**
|
||||
* 解除用户与部门的绑定关系
|
||||
*
|
||||
* @param userIds 用户ID列表
|
||||
* @param deptId 部门ID
|
||||
*/
|
||||
void unBindDept(List<Long> userIds, Long deptId);
|
||||
|
||||
/**
|
||||
* 解除部门的所有绑定关系
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
*/
|
||||
void unBindAllDept(Long deptId);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
import cn.fateverse.admin.entity.UserPost;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/26
|
||||
*/
|
||||
public interface UserPostMapper {
|
||||
/**
|
||||
* 批量新增用户角色映射关系
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(List<UserPost> list);
|
||||
|
||||
/**
|
||||
* 获取用户对应的岗位id
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectPostIdListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户id删除角色菜单映射表
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int deleteByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 解除用户于角色之前的绑定关系
|
||||
*
|
||||
* @param userIds
|
||||
* @param postId
|
||||
* @return
|
||||
*/
|
||||
int removeBind(@Param("userIds") List<Long> userIds, @Param("postId") Long postId);
|
||||
|
||||
/**
|
||||
* 接触当前岗位与所有用户的绑定关系
|
||||
*
|
||||
* @param postId 岗位id
|
||||
* @return 执行结果
|
||||
*/
|
||||
int removeBindByPostId(Long postId);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.fateverse.admin.mapper;
|
||||
|
||||
|
||||
import cn.fateverse.admin.entity.UserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/6
|
||||
*/
|
||||
public interface UserRoleMapper {
|
||||
|
||||
/**
|
||||
* 批量新增用户角色映射关系
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(List<UserRole> list);
|
||||
|
||||
/**
|
||||
* 根据用户id删除角色菜单映射表
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int deleteByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据角色删除映射关系
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int deleteByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 解除用户于角色之前的绑定关系
|
||||
*
|
||||
* @param userIds
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int unBind(@Param("userIds") List<Long> userIds, @Param("roleId") Long roleId);
|
||||
|
||||
/**
|
||||
* 用户于角色之前的绑定关系
|
||||
*
|
||||
* @param userIds
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
int bind(@Param("userIds") List<Long> userIds, @Param("roleId") Long roleId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.dto.ConfigDto;
|
||||
import cn.fateverse.admin.query.ConfigQuery;
|
||||
import cn.fateverse.admin.vo.ConfigVo;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置表 Service
|
||||
*
|
||||
* @author clay
|
||||
* @date 2023-06-09
|
||||
*/
|
||||
public interface ConfigService {
|
||||
|
||||
/**
|
||||
* 查询参数配置表
|
||||
*
|
||||
* @param configId 参数配置表Id
|
||||
* @return 参数配置表
|
||||
*/
|
||||
ConfigVo searchById(Integer configId);
|
||||
|
||||
/**
|
||||
* 查询参数配置表列表
|
||||
*
|
||||
* @param query 参数配置表
|
||||
* @return 参数配置表集合
|
||||
*/
|
||||
TableDataInfo<ConfigVo> searchList(ConfigQuery query);
|
||||
|
||||
|
||||
|
||||
TableDataInfo<ConfigVo> searchListPage(ConfigQuery query);
|
||||
/**
|
||||
* 查询参数配置表option
|
||||
*
|
||||
* @return 选项集合
|
||||
*/
|
||||
|
||||
/**
|
||||
* 导出参数配置表列表
|
||||
*
|
||||
* @param query query 参数配置表
|
||||
* @return 参数配置表集合
|
||||
*/
|
||||
List<ConfigVo> exportList(ConfigQuery query);
|
||||
|
||||
/**
|
||||
* 新增参数配置表
|
||||
*
|
||||
* @param config 参数配置表
|
||||
* @return 结果
|
||||
*/
|
||||
int save(ConfigDto config);
|
||||
|
||||
/**
|
||||
* 修改参数配置表
|
||||
*
|
||||
* @param config 参数配置表
|
||||
* @return 结果
|
||||
*/
|
||||
int edit(ConfigDto config);
|
||||
|
||||
/**
|
||||
* 删除参数配置表
|
||||
*
|
||||
* @param configId 需要删除的参数配置表Id
|
||||
* @return 结果
|
||||
*/
|
||||
int removeById(Integer configId);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置表
|
||||
*
|
||||
* @param configIdList 需要删除的参数配置表Id 集合
|
||||
* @return 结果
|
||||
*/
|
||||
int removeBatch(List<Integer> configIdList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.vo.DeptVo;
|
||||
import cn.fateverse.admin.entity.Dept;
|
||||
import cn.fateverse.common.core.entity.OptionTree;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/2
|
||||
*/
|
||||
public interface DeptService {
|
||||
|
||||
/**
|
||||
* 查询部门树形结构数据
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param state 部门状态
|
||||
* @return 部门集合
|
||||
*/
|
||||
List<DeptVo> searchTree(String deptName, Integer state);
|
||||
|
||||
/**
|
||||
* 部门id查询部门信息
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 返回对象
|
||||
*/
|
||||
DeptVo searchById(Long deptId);
|
||||
|
||||
/**
|
||||
* 获取排除自身的部门树形结构
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 部门树形选择对象
|
||||
*/
|
||||
List<OptionTree> searchExcludeTree(Long deptId);
|
||||
|
||||
/**
|
||||
* 获取部门选择的树形结构
|
||||
*
|
||||
* @return 部门树形选择对象
|
||||
*/
|
||||
List<OptionTree> searchTreeOption();
|
||||
|
||||
/**
|
||||
* 通过ids获取到部门数据
|
||||
*
|
||||
* @param deptIds 部门id列表
|
||||
* @return 部门集合对象
|
||||
*/
|
||||
List<DeptVo> searchByIds(List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 结果
|
||||
*/
|
||||
String checkNameUnique(Dept dept);
|
||||
|
||||
/**
|
||||
* 是否存在部门子节点
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
boolean hasChildById(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
boolean checkExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 影响条数
|
||||
*/
|
||||
int save(Dept dept);
|
||||
|
||||
/**
|
||||
* 更新部门信息
|
||||
*
|
||||
* @param dept 部门对象
|
||||
* @return 影响条数
|
||||
*/
|
||||
int edit(Dept dept);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 影响条数
|
||||
*/
|
||||
int remove(Long deptId);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.entity.DictData;
|
||||
import cn.fateverse.common.core.constant.CacheConstants;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Component
|
||||
public class DictCacheService {
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, List<DictData>> redisTemplate;
|
||||
|
||||
|
||||
public void set(String key, List<DictData> dictDataList) {
|
||||
redisTemplate.opsForValue().set(getCacheKey(key), dictDataList);
|
||||
}
|
||||
|
||||
public void setInit(String key, List<DictData> dictDataList) {
|
||||
String cacheKey = getCacheKey(key);
|
||||
List<DictData> dictData = redisTemplate.opsForValue().get(cacheKey);
|
||||
if (null == dictData) {
|
||||
redisTemplate.opsForValue().set(cacheKey, dictDataList);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTime(String key, List<DictData> dictDataList) {
|
||||
redisTemplate.opsForValue().set(getCacheKey(key), dictDataList, 30L, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
public List<DictData> get(String key) {
|
||||
return redisTemplate.opsForValue().get(getCacheKey(key));
|
||||
}
|
||||
|
||||
public String getCacheKey(String key) {
|
||||
return CacheConstants.DICT_KEY + key;
|
||||
}
|
||||
|
||||
public void remove(String key) {
|
||||
String cacheKey = getCacheKey(key);
|
||||
redisTemplate.delete(cacheKey);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
Set<String> keys = redisTemplate.keys(CacheConstants.DICT_KEY + "*");
|
||||
if (keys != null && !keys.isEmpty()) {
|
||||
redisTemplate.delete(keys);
|
||||
}
|
||||
}
|
||||
|
||||
@Async("fateverseExecutor")
|
||||
public void asyncRemove(String key) {
|
||||
remove(key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.dto.DictDataDto;
|
||||
import cn.fateverse.admin.query.DictDataQuery;
|
||||
import cn.fateverse.admin.vo.DictDataSimpVo;
|
||||
import cn.fateverse.admin.vo.DictDataVo;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface DictDataService {
|
||||
|
||||
/**
|
||||
* 查询字典信息
|
||||
*
|
||||
* @param query 查询对象
|
||||
* @return 表格信息数据
|
||||
*/
|
||||
TableDataInfo<DictDataVo> searchList(DictDataQuery query);
|
||||
|
||||
/**
|
||||
* 根据code查询字典数据
|
||||
*
|
||||
* @param dictCode 字典code
|
||||
* @return 字典数据信息
|
||||
*/
|
||||
DictDataVo searchByCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 新增字典数据
|
||||
*
|
||||
* @param dto 字典数据
|
||||
*/
|
||||
void save(DictDataDto dto);
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
*
|
||||
* @param dto 字典数据
|
||||
*/
|
||||
void edit(DictDataDto dto);
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
*
|
||||
* @param dictCode 字典数据code
|
||||
*/
|
||||
void removeByCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
*
|
||||
* @param dictCodeList 字典数据code list
|
||||
*/
|
||||
void removeBatch(List<Long> dictCodeList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取到option的字典数据
|
||||
*
|
||||
* @param cacheKey 字典缓存key
|
||||
* @return option选项列表
|
||||
*/
|
||||
List<Option> option(String cacheKey);
|
||||
|
||||
/**
|
||||
* 批量获取缓存字典
|
||||
*
|
||||
* @param cacheKeys 字典缓存列表
|
||||
* @return 映射完成后的字典对象
|
||||
*/
|
||||
Map<String, Map<String, DictDataVo>> searchCacheKeys(List<String> cacheKeys);
|
||||
|
||||
/**
|
||||
* 获取到完整的字典数据
|
||||
*
|
||||
* @param cacheKeys 字典缓存key
|
||||
* @return 字典数据简单返回对象
|
||||
*/
|
||||
Map<String,List<DictDataSimpVo>> get(List<String> cacheKeys);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.query.DictTypeQuery;
|
||||
import cn.fateverse.admin.entity.DictType;
|
||||
import cn.fateverse.common.core.entity.Option;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface DictTypeService {
|
||||
|
||||
|
||||
/**
|
||||
* 记载字段缓存数据
|
||||
*/
|
||||
void loadingDictCache();
|
||||
|
||||
/**
|
||||
* 清除缓存记录
|
||||
*/
|
||||
void clearDictCache();
|
||||
|
||||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
void resetDictCache();
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*
|
||||
* @param query 字典类型查询
|
||||
* @return 字典类型列表
|
||||
*/
|
||||
List<DictType> searchList(DictTypeQuery query);
|
||||
|
||||
/**
|
||||
* 获取到字典类型的option
|
||||
*
|
||||
* @return 选项列表
|
||||
*/
|
||||
List<Option> searchOption();
|
||||
|
||||
/**
|
||||
* 通过id查询字典类型信息
|
||||
*
|
||||
* @param dictId 字典类型id
|
||||
* @return 字典类型数据
|
||||
*/
|
||||
DictType searchById(Long dictId);
|
||||
|
||||
/**
|
||||
* 检查dictType是否唯一
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 检查结果
|
||||
*/
|
||||
boolean checkUnique(DictType dictType);
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
*/
|
||||
void save(DictType dictType);
|
||||
|
||||
/**
|
||||
* 更新字典类型
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
*/
|
||||
void edit(DictType dictType);
|
||||
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*
|
||||
* @param dictId 字典id
|
||||
*/
|
||||
void removeById(Long dictId);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.fateverse.admin.service;
|
||||
|
||||
import cn.fateverse.admin.dto.IpBackDto;
|
||||
import cn.fateverse.admin.query.IpBackQuery;
|
||||
import cn.fateverse.admin.vo.IpBackVo;
|
||||
import cn.fateverse.common.core.result.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Clay
|
||||
* @date 2023-10-22
|
||||
*/
|
||||
public interface IpBackService {
|
||||
|
||||
/**
|
||||
* 查询ip黑名单列表
|
||||
*
|
||||
* @param query 查询对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
TableDataInfo<IpBackVo> search(IpBackQuery query);
|
||||
|
||||
/**
|
||||
* 校验ip是否为黑名单
|
||||
*
|
||||
* @param ipAddress 校验的ip地址
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean match(String ipAddress);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id id
|
||||
* @return ip黑名单
|
||||
*/
|
||||
IpBackVo searchById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param dto ip黑名单
|
||||
*/
|
||||
void save(IpBackDto dto);
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param dto ip黑名单
|
||||
*/
|
||||
void edit(IpBackDto dto);
|
||||
|
||||
/**
|
||||
* 删除ip
|
||||
*
|
||||
* @param ids ip列表
|
||||
*/
|
||||
void delete(List<Long> ids);
|
||||
|
||||
|
||||
List<IpBackVo> exportList(IpBackQuery query);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user