新版本初始化2025-11-15

This commit is contained in:
vben
2025-11-15 16:25:20 +08:00
parent ab83308a4e
commit 40c8bbd641
736 changed files with 58010 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?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>vben-java</artifactId>
<groupId>com.zsvg</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>vben-apps</artifactId>
<packaging>pom</packaging>
<modules>
<module>vben-admin</module>
<module>vben-mybatis</module>
<module>vben-setup</module>
<module>vben-jpa</module>
</modules>
<description>
自定义应用层
</description>
</project>
+31
View File
@@ -0,0 +1,31 @@
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds
#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds
#FROM findepi/graalvm:java17-native
LABEL maintainer="baby_fox"
RUN mkdir -p /vben/server/logs \
/vben/server/temp \
/vben/skywalking/agent
WORKDIR /vben/server
ENV SERVER_PORT=8080 SNAIL_PORT=28080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
# 暴露 snail job 客户端端口 用于定时任务调度中心通信
EXPOSE ${SNAIL_PORT}
ADD ./target/vben-admin.jar ./app.jar
SHELL ["/bin/bash", "-c"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
-Dsnail-job.port=${SNAIL_PORT} \
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
#-Dskywalking.agent.service_name=vben-server \
#-javaagent:/vben/skywalking/agent/skywalking-agent.jar \
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
-jar app.jar
+111
View File
@@ -0,0 +1,111 @@
<?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>vben-apps</artifactId>
<groupId>com.zsvg</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>vben-admin</artifactId>
<description>
XXX管理系统
</description>
<dependencies>
<!-- Mysql驱动包 -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- &lt;!&ndash; mp支持的数据库均支持 只需要增加对应的jdbc依赖即可 &ndash;&gt;-->
<!-- &lt;!&ndash; Oracle &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.jdbc</groupId>-->
<!-- <artifactId>ojdbc8</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 兼容oracle低版本 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.nls</groupId>-->
<!-- <artifactId>orai18n</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; PostgreSql &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SqlServer &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
<!-- <artifactId>mssql-jdbc</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-wf</artifactId>
</dependency>
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- skywalking 整合 logback -->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,18 @@
package vben;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author Lion Li
*/
public class DromaraServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(VbenAdmin.class);
}
}
@@ -0,0 +1,22 @@
package vben;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
/**
* 启动程序
*
*/
@SpringBootApplication
public class VbenAdmin {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(VbenAdmin.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ Vben Admin启动成功 ლ(´ڡ`ლ)゙");
}
}
@@ -0,0 +1,276 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
dynamic:
# 性能分析插件(有性能损耗 不建议生产环境使用)
p6spy: true
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
# 严格模式 匹配不到数据源则报错
strict: true
datasource:
# 主库数据源
master:
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# # 从库数据源
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username:
# password:
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@//localhost:1521/XE
# username: ROOT
# password: root
# postgres:
# type: ${spring.datasource.type}
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: root
# password: root
# sqlserver:
# type: ${spring.datasource.type}
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
# username: SA
# password: root
hikari:
# 最大连接池数量
maxPoolSize: 20
# 最小空闲线程数量
minIdle: 10
# 配置获取连接等待超时的时间
connectionTimeout: 30000
# 校验超时时间
validationTimeout: 5000
# 空闲连接存活最大时间,默认10分钟
idleTimeout: 600000
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
maxLifetime: 1800000
# 多久检查一次连接的活性
keepaliveTime: 30000
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
#app:
#附件地址,不设置而时默认为项目根目录下的/zsvg/atts
# attpath: C:/vben/att
@@ -0,0 +1,277 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
dynamic:
# 性能分析插件(有性能损耗 不建议生产环境使用)
p6spy: true
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
# 严格模式 匹配不到数据源则报错
strict: true
datasource:
# 主库数据源
master:
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# # 从库数据源
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username:
# password:
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@//localhost:1521/XE
# username: ROOT
# password: root
# postgres:
# type: ${spring.datasource.type}
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: root
# password: root
# sqlserver:
# type: ${spring.datasource.type}
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
# username: SA
# password: root
hikari:
# 最大连接池数量
maxPoolSize: 20
# 最小空闲线程数量
minIdle: 10
# 配置获取连接等待超时的时间
connectionTimeout: 30000
# 校验超时时间
validationTimeout: 5000
# 空闲连接存活最大时间,默认10分钟
idleTimeout: 600000
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
maxLifetime: 1800000
# 多久检查一次连接的活性
keepaliveTime: 30000
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
app:
# 前端外网访问地址
attpath: C:/vben/att
# attpath: /home/app/att
@@ -0,0 +1,267 @@
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
# undertow 配置
undertow:
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
threads:
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
io: 8
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
worker: 256
captcha:
# 是否启用验证码校验
enable: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 日志配置
logging:
level:
vben: @logging.level@
org.springframework: warn
org.mybatis.spring.mapper: error
org.apache.fury: warn
config: classpath:logback.xml
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间(默认10分钟)
lockTime: 10
# Spring配置
spring:
application:
name: vben-admin
threads:
# 开启虚拟线程 仅jdk21可用
virtual:
enabled: true
task:
execution:
# 从 springboot 3.5 开始 spring自带线程池
# 不再需要 AsyncConfig与ThreadPoolConfig 可直接注入线程池使用
thread-name-prefix: async-
# 由spring自己初始化线程池
mode: force
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: @profiles.active@
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
mvc:
# 设置静态资源路径 防止所有请求都去查静态资源
static-path-pattern: /static/**
format:
date-time: yyyy-MM-dd HH:mm:ss
jackson:
# 日期格式化
date-format: yyyy-MM-dd HH:mm:ss
serialization:
# 格式化输出
indent_output: false
# 忽略无法转换的对象
fail_on_empty_beans: false
deserialization:
# 允许对象忽略json中不存在的属性
fail_on_unknown_properties: false
# Sa-Token配置
sa-token:
# token名称 (同时也是cookie名称)
token-name: Authorization
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
is-share: false
# jwt秘钥
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
# security配置
security:
# 排除路径
excludes:
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /favicon.ico
- /error
- /*/api-docs
- /*/api-docs/**
- /warm-flow-ui/config
# 多租户配置
tenant:
# 是否开启
enable: true
# 排除表
excludes:
- sys_menu
- sys_tenant
- sys_tenant_package
- sys_role_dept
- sys_role_menu
- sys_user_post
- sys_user_role
- sys_client
- sys_oss_config
- flow_spel
# MyBatisPlus配置
# https://baomidou.com/config/
mybatis-plus:
# 自定义配置 是否全局开启逻辑删除 关闭后 所有逻辑删除功能将失效
enableLogicDelete: true
# 多包名使用 例如 vben.**.mapper,org.xxx.**.mapper
mapperPackage: vben.**.mapper
# 对应的 XML 文件位置
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: vben.**.domain
global-config:
dbConfig:
# 主键类型
# AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
# 如需改为自增 需要将数据库表全部设置为自增
idType: ASSIGN_ID
# 数据加密
mybatis-encryptor:
# 是否开启加密
enable: false
# 默认加密算法
algorithm: BASE64
# 编码方式 BASE64/HEX。默认BASE64
encode: BASE64
# 安全秘钥 对称算法的秘钥 如:AES,SM4
password:
# 公私钥 非对称算法的公私钥 如:SM2,RSA
publicKey:
privateKey:
# api接口加密
api-decrypt:
# 是否开启全局接口加密
enabled: true
# AES 加密头标识
headerFlag: encrypt-key
# 响应加密公钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端解密私钥 MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnNwrj4hi/y3CCJu868ghCG5dUj8wZK++RNlTLcXoMmdZWEQ/u02RgD5LyLAXGjLOjbMtC+/J9qofpSGTKSx/MCAwEAAQ==
# 请求解密私钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端加密公钥 MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
privateKey: MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=
springdoc:
api-docs:
# 是否开启接口文档
enabled: true
info:
# 标题
title: '标题:vben-admin后台管理系统_接口文档'
# 描述
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
# 版本
version: '版本号: ${project.version}'
# 作者信息
contact:
name: baby_fox
email: 676948472@qq.com
url: https://gitee.com/vben/vben-java
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
- group: 1.自定义应用
packages-to-scan: vben.admin
- group: 2.系统管理
packages-to-scan: vben.base.sys
- group: 3.监控中心
packages-to-scan: vben.base.mon
- group: 4.辅助工具
packages-to-scan: vben.base.tool
- group: 5.工作流
packages-to-scan: vben.wf
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接
excludeUrls:
- /system/notice
- /oa/flow/tmpl
- /wf/bus/tmpl
--- # 分布式锁 lock4j 全局配置
lock4j:
# 获取分布式锁超时时间,默认为 3000 毫秒
acquire-timeout: 3000
# 分布式锁的超时时间,默认为 30 秒
expire: 30000
--- # Actuator 监控端点的配置项
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
logfile:
external-file: ./logs/sys-console.log
--- # 默认/推荐使用sse推送
sse:
enabled: true
path: /resource/sse
--- # websocket
websocket:
# 如果关闭 需要和前端开关一起关闭
enabled: false
# 路径
path: /resource/websocket
# 设置访问源地址
allowedOrigins: '*'
--- # warm-flow工作流配置
warm-flow:
# 是否开启工作流,默认true
enabled: true
# 是否开启设计器ui
ui: true
# 是否显示流程图顶部文字
top-text-show: true
# 是否渲染节点悬浮提示,默认true
node-tooltip: true
# 默认Authorization,如果有多个token,用逗号分隔
token-name: ${sa-token.token-name},clientid
@@ -0,0 +1,11 @@
Application Version: ${revision}
Spring Boot Version: ${spring-boot.version}
8b d8 88 db 88 88
`8b d8' 88 d88b 88 ""
`8b d8' 88 d8'`8b 88
`8b d8' 88,dPPYba, ,adPPYba, 8b,dPPYba, d8' `8b ,adPPYb,88 88,dPYba,,adPYba, 88 8b,dPPYba,
`8b d8' 88P' "8a a8P_____88 88P' `"8a d8YaaaaY8b a8" `Y88 88P' "88" "8a 88 88P' `"8a
`8b d8' 88 d8 8PP""""""" 88 88 d8""""""""8b 8b 88 88 88 88 88 88 88
`888' 88b, ,a8" "8b, ,aa 88 88 d8' `8b "8a, ,d88 88 88 88 88 88 88
`8' 8Y"Ybbd8"' `"Ybbd8"' 88 88 d8' `8b `"8bbdP"Y8 88 88 88 88 88 88
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
@@ -0,0 +1,62 @@
#错误消息
not.null=* Required fill in
user.jcaptcha.error=Captcha error
user.jcaptcha.expire=Captcha invalid
user.not.exists=Sorry, your account: {0} does not exist
user.password.not.match=User does not exist/Password error
user.password.retry.limit.count=Password input error {0} times
user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes
user.password.delete=Sorry, your account:{0} has been deleted
user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator
role.blocked=Role disabled,please contact administrators
user.logout.success=Exit successful
length.not.valid=The length must be between {min} and {max} characters
user.username.not.blank=Username cannot be blank
user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number
user.username.length.valid=Account length must be between {min} and {max} characters
user.password.not.blank=Password cannot be empty
user.password.length.valid=Password length must be between {min} and {max} characters
user.password.not.valid=* 5-50 characters
user.password.format.valid=Password must contain uppercase, lowercase, digit, and special character
user.email.not.valid=Mailbox format error
user.email.not.blank=Mailbox cannot be blank
user.phonenumber.not.blank=Phone number cannot be blank
user.mobile.phone.number.not.valid=Phone number format error
user.login.success=Login successful
user.register.success=Register successful
user.register.save.error=Failed to save user {0}, The registered account already exists
user.register.error=Register failed, please contact system administrator
user.notfound=Please login again
user.forcelogout=The administrator is forced to exit,please login again
user.unknown.error=Unknown error, please login again
auth.grant.type.error=Auth grant type error
auth.grant.type.blocked=Auth grant type disabled
auth.grant.type.not.blank=Auth grant type cannot be blank
auth.clientid.not.blank=Auth clientid cannot be blank
##文件上传消息
upload.exceed.maxSize=The uploaded file size exceeds the limit file size!<br/>the maximum allowed file size is:{0}MB!
upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters
##权限
no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}]
no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}]
no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}]
no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}]
no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}]
no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}]
repeat.submit.message=Repeat submit is not allowed, please try again later
rate.limiter.message=Visit too frequently, please try again later
sms.code.not.blank=Sms code cannot be blank
sms.code.retry.limit.count=Sms code input error {0} times
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes
email.code.not.blank=Email code cannot be blank
email.code.retry.limit.count=Email code input error {0} times
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes
xcx.code.not.blank=Mini program [code] cannot be blank
social.source.not.blank=Social login platform [source] cannot be blank
social.code.not.blank=Social login platform [code] cannot be blank
social.state.not.blank=Social login platform [state] cannot be blank
##租户
tenant.number.not.blank=Tenant number cannot be blank
tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator
tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator
tenant.expired=Sorry, your tenant has expired. Please contact the administrator.
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.path" value="./zsvg/logs"/>
<property name="console.log.pattern"
value="%cyan(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-console.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大 1天 -->
<maxHistory>1</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- info异步输出 -->
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_info"/>
</appender>
<!-- error异步输出 -->
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_error"/>
</appender>
<!-- 整合 skywalking 控制台输出 tid -->
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!-- 整合 skywalking 推送采集日志 -->
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console" />
<appender-ref ref="async_info" />
<appender-ref ref="async_error" />
<appender-ref ref="file_console" />
<!-- <appender-ref ref="sky_log"/>-->
</root>
</configuration>
+31
View File
@@ -0,0 +1,31 @@
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds
#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds
#FROM findepi/graalvm:java17-native
LABEL maintainer="baby_fox"
RUN mkdir -p /vben/server/logs \
/vben/server/temp \
/vben/skywalking/agent
WORKDIR /vben/server
ENV SERVER_PORT=8080 SNAIL_PORT=28080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
# 暴露 snail job 客户端端口 用于定时任务调度中心通信
EXPOSE ${SNAIL_PORT}
ADD ./target/vben-jpa.jar ./app.jar
SHELL ["/bin/bash", "-c"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
-Dsnail-job.port=${SNAIL_PORT} \
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
#-Dskywalking.agent.service_name=vben-server \
#-javaagent:/vben/skywalking/agent/skywalking-agent.jar \
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
-jar app.jar
+111
View File
@@ -0,0 +1,111 @@
<?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>vben-apps</artifactId>
<groupId>com.zsvg</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>vben-jpa</artifactId>
<description>
Jpa示例应用
</description>
<dependencies>
<!-- Mysql驱动包 -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- &lt;!&ndash; mp支持的数据库均支持 只需要增加对应的jdbc依赖即可 &ndash;&gt;-->
<!-- &lt;!&ndash; Oracle &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.jdbc</groupId>-->
<!-- <artifactId>ojdbc8</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 兼容oracle低版本 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.nls</groupId>-->
<!-- <artifactId>orai18n</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; PostgreSql &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SqlServer &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
<!-- <artifactId>mssql-jdbc</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-wf</artifactId>
</dependency>
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-common-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- skywalking 整合 logback -->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,18 @@
package vben;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author Lion Li
*/
public class DromaraServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(VbenJpa.class);
}
}
@@ -0,0 +1,22 @@
package vben;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
/**
* 启动程序
*
*/
@SpringBootApplication
public class VbenJpa {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(VbenJpa.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ Vben Jpa启动成功 ლ(´ڡ`ლ)゙");
}
}
@@ -0,0 +1,229 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
primary:
dbType: mysql
validationQuery: SELECT 1 FROM DUAL
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
jpa:
entityScan: vben
hbm2ddl:
auto: update
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
#app:
#附件地址,不设置而时默认为项目根目录下的/zsvg/atts
# attpath: C:/vben/att
@@ -0,0 +1,230 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
primary:
dbType: mysql
validationQuery: SELECT 1 FROM DUAL
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
jpa:
entityScan: vben
hbm2ddl:
auto: update
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
app:
# 前端外网访问地址
attpath: C:/vben/att
# attpath: /home/app/att
@@ -0,0 +1,267 @@
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
# undertow 配置
undertow:
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
threads:
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
io: 8
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
worker: 256
captcha:
# 是否启用验证码校验
enable: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 日志配置
logging:
level:
vben: @logging.level@
org.springframework: warn
org.mybatis.spring.mapper: error
org.apache.fury: warn
config: classpath:logback.xml
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间(默认10分钟)
lockTime: 10
# Spring配置
spring:
application:
name: vben-admin
threads:
# 开启虚拟线程 仅jdk21可用
virtual:
enabled: true
task:
execution:
# 从 springboot 3.5 开始 spring自带线程池
# 不再需要 AsyncConfig与ThreadPoolConfig 可直接注入线程池使用
thread-name-prefix: async-
# 由spring自己初始化线程池
mode: force
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: @profiles.active@
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
mvc:
# 设置静态资源路径 防止所有请求都去查静态资源
static-path-pattern: /static/**
format:
date-time: yyyy-MM-dd HH:mm:ss
jackson:
# 日期格式化
date-format: yyyy-MM-dd HH:mm:ss
serialization:
# 格式化输出
indent_output: false
# 忽略无法转换的对象
fail_on_empty_beans: false
deserialization:
# 允许对象忽略json中不存在的属性
fail_on_unknown_properties: false
# Sa-Token配置
sa-token:
# token名称 (同时也是cookie名称)
token-name: Authorization
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
is-share: false
# jwt秘钥
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
# security配置
security:
# 排除路径
excludes:
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /favicon.ico
- /error
- /*/api-docs
- /*/api-docs/**
- /warm-flow-ui/config
# 多租户配置
tenant:
# 是否开启
enable: true
# 排除表
excludes:
- sys_menu
- sys_tenant
- sys_tenant_package
- sys_role_dept
- sys_role_menu
- sys_user_post
- sys_user_role
- sys_client
- sys_oss_config
- flow_spel
# MyBatisPlus配置
# https://baomidou.com/config/
mybatis-plus:
# 自定义配置 是否全局开启逻辑删除 关闭后 所有逻辑删除功能将失效
enableLogicDelete: true
# 多包名使用 例如 vben.**.mapper,org.xxx.**.mapper
mapperPackage: vben.**.mapper
# 对应的 XML 文件位置
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: vben.**.domain
global-config:
dbConfig:
# 主键类型
# AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
# 如需改为自增 需要将数据库表全部设置为自增
idType: ASSIGN_ID
# 数据加密
mybatis-encryptor:
# 是否开启加密
enable: false
# 默认加密算法
algorithm: BASE64
# 编码方式 BASE64/HEX。默认BASE64
encode: BASE64
# 安全秘钥 对称算法的秘钥 如:AES,SM4
password:
# 公私钥 非对称算法的公私钥 如:SM2,RSA
publicKey:
privateKey:
# api接口加密
api-decrypt:
# 是否开启全局接口加密
enabled: true
# AES 加密头标识
headerFlag: encrypt-key
# 响应加密公钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端解密私钥 MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnNwrj4hi/y3CCJu868ghCG5dUj8wZK++RNlTLcXoMmdZWEQ/u02RgD5LyLAXGjLOjbMtC+/J9qofpSGTKSx/MCAwEAAQ==
# 请求解密私钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端加密公钥 MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
privateKey: MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=
springdoc:
api-docs:
# 是否开启接口文档
enabled: true
info:
# 标题
title: '标题:vben-admin后台管理系统_接口文档'
# 描述
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
# 版本
version: '版本号: ${project.version}'
# 作者信息
contact:
name: baby_fox
email: 676948472@qq.com
url: https://gitee.com/vben/vben-java
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
- group: 1.自定义应用
packages-to-scan: vben.admin
- group: 2.系统管理
packages-to-scan: vben.base.sys
- group: 3.监控中心
packages-to-scan: vben.base.mon
- group: 4.辅助工具
packages-to-scan: vben.base.tool
- group: 5.工作流
packages-to-scan: vben.wf
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接
excludeUrls:
- /system/notice
- /oa/flow/tmpl
- /wf/bus/tmpl
--- # 分布式锁 lock4j 全局配置
lock4j:
# 获取分布式锁超时时间,默认为 3000 毫秒
acquire-timeout: 3000
# 分布式锁的超时时间,默认为 30 秒
expire: 30000
--- # Actuator 监控端点的配置项
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
logfile:
external-file: ./logs/sys-console.log
--- # 默认/推荐使用sse推送
sse:
enabled: true
path: /resource/sse
--- # websocket
websocket:
# 如果关闭 需要和前端开关一起关闭
enabled: false
# 路径
path: /resource/websocket
# 设置访问源地址
allowedOrigins: '*'
--- # warm-flow工作流配置
warm-flow:
# 是否开启工作流,默认true
enabled: true
# 是否开启设计器ui
ui: true
# 是否显示流程图顶部文字
top-text-show: true
# 是否渲染节点悬浮提示,默认true
node-tooltip: true
# 默认Authorization,如果有多个token,用逗号分隔
token-name: ${sa-token.token-name},clientid
@@ -0,0 +1,14 @@
Application Version: ${revision}
Spring Boot Version: ${spring-boot.version}
8b d8 88 88
`8b d8' 88 88
`8b d8' 88 88
`8b d8' 88,dPPYba, ,adPPYba, 8b,dPPYba, 88 8b,dPPYba, ,adPPYYba,
`8b d8' 88P' "8a a8P_____88 88P' `"8a 88 88P' "8a "" `Y8
`8b d8' 88 d8 8PP""""""" 88 88 88 88 d8 ,adPPPPP88
`888' 88b, ,a8" "8b, ,aa 88 88 88, ,d88 88b, ,a8" 88, ,88
`8' 8Y"Ybbd8"' `"Ybbd8"' 88 88 "Y8888P" 88`YbbdP"' `"8bbdP"Y8
88
88
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
@@ -0,0 +1,62 @@
#错误消息
not.null=* Required fill in
user.jcaptcha.error=Captcha error
user.jcaptcha.expire=Captcha invalid
user.not.exists=Sorry, your account: {0} does not exist
user.password.not.match=User does not exist/Password error
user.password.retry.limit.count=Password input error {0} times
user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes
user.password.delete=Sorry, your account:{0} has been deleted
user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator
role.blocked=Role disabled,please contact administrators
user.logout.success=Exit successful
length.not.valid=The length must be between {min} and {max} characters
user.username.not.blank=Username cannot be blank
user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number
user.username.length.valid=Account length must be between {min} and {max} characters
user.password.not.blank=Password cannot be empty
user.password.length.valid=Password length must be between {min} and {max} characters
user.password.not.valid=* 5-50 characters
user.password.format.valid=Password must contain uppercase, lowercase, digit, and special character
user.email.not.valid=Mailbox format error
user.email.not.blank=Mailbox cannot be blank
user.phonenumber.not.blank=Phone number cannot be blank
user.mobile.phone.number.not.valid=Phone number format error
user.login.success=Login successful
user.register.success=Register successful
user.register.save.error=Failed to save user {0}, The registered account already exists
user.register.error=Register failed, please contact system administrator
user.notfound=Please login again
user.forcelogout=The administrator is forced to exit,please login again
user.unknown.error=Unknown error, please login again
auth.grant.type.error=Auth grant type error
auth.grant.type.blocked=Auth grant type disabled
auth.grant.type.not.blank=Auth grant type cannot be blank
auth.clientid.not.blank=Auth clientid cannot be blank
##文件上传消息
upload.exceed.maxSize=The uploaded file size exceeds the limit file size!<br/>the maximum allowed file size is:{0}MB!
upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters
##权限
no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}]
no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}]
no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}]
no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}]
no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}]
no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}]
repeat.submit.message=Repeat submit is not allowed, please try again later
rate.limiter.message=Visit too frequently, please try again later
sms.code.not.blank=Sms code cannot be blank
sms.code.retry.limit.count=Sms code input error {0} times
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes
email.code.not.blank=Email code cannot be blank
email.code.retry.limit.count=Email code input error {0} times
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes
xcx.code.not.blank=Mini program [code] cannot be blank
social.source.not.blank=Social login platform [source] cannot be blank
social.code.not.blank=Social login platform [code] cannot be blank
social.state.not.blank=Social login platform [state] cannot be blank
##租户
tenant.number.not.blank=Tenant number cannot be blank
tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator
tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator
tenant.expired=Sorry, your tenant has expired. Please contact the administrator.
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
Binary file not shown.
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.path" value="./zsvg/logs"/>
<property name="console.log.pattern"
value="%cyan(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-console.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大 1天 -->
<maxHistory>1</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- info异步输出 -->
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_info"/>
</appender>
<!-- error异步输出 -->
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_error"/>
</appender>
<!-- 整合 skywalking 控制台输出 tid -->
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!-- 整合 skywalking 推送采集日志 -->
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console" />
<appender-ref ref="async_info" />
<appender-ref ref="async_error" />
<appender-ref ref="file_console" />
<!-- <appender-ref ref="sky_log"/>-->
</root>
</configuration>
+31
View File
@@ -0,0 +1,31 @@
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds
#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds
#FROM findepi/graalvm:java17-native
LABEL maintainer="baby_fox"
RUN mkdir -p /vben/server/logs \
/vben/server/temp \
/vben/skywalking/agent
WORKDIR /vben/server
ENV SERVER_PORT=8080 SNAIL_PORT=28080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
# 暴露 snail job 客户端端口 用于定时任务调度中心通信
EXPOSE ${SNAIL_PORT}
ADD ./target/vben-jpa.jar ./app.jar
SHELL ["/bin/bash", "-c"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
-Dsnail-job.port=${SNAIL_PORT} \
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
#-Dskywalking.agent.service_name=vben-server \
#-javaagent:/vben/skywalking/agent/skywalking-agent.jar \
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
-jar app.jar
+111
View File
@@ -0,0 +1,111 @@
<?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>vben-apps</artifactId>
<groupId>com.zsvg</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>vben-mybatis</artifactId>
<description>
Mybatis示例应用
</description>
<dependencies>
<!-- Mysql驱动包 -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- &lt;!&ndash; mp支持的数据库均支持 只需要增加对应的jdbc依赖即可 &ndash;&gt;-->
<!-- &lt;!&ndash; Oracle &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.jdbc</groupId>-->
<!-- <artifactId>ojdbc8</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 兼容oracle低版本 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.nls</groupId>-->
<!-- <artifactId>orai18n</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; PostgreSql &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SqlServer &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
<!-- <artifactId>mssql-jdbc</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-wf</artifactId>
</dependency>
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- skywalking 整合 logback -->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,18 @@
package vben;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author Lion Li
*/
public class DromaraServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(VbenMybatis.class);
}
}
@@ -0,0 +1,22 @@
package vben;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
/**
* 启动程序
*
*/
@SpringBootApplication
public class VbenMybatis {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(VbenMybatis.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ Vben Mybatis启动成功 ლ(´ڡ`ლ)゙");
}
}
@@ -0,0 +1,276 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
dynamic:
# 性能分析插件(有性能损耗 不建议生产环境使用)
p6spy: true
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
# 严格模式 匹配不到数据源则报错
strict: true
datasource:
# 主库数据源
master:
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# # 从库数据源
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username:
# password:
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@//localhost:1521/XE
# username: ROOT
# password: root
# postgres:
# type: ${spring.datasource.type}
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: root
# password: root
# sqlserver:
# type: ${spring.datasource.type}
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
# username: SA
# password: root
hikari:
# 最大连接池数量
maxPoolSize: 20
# 最小空闲线程数量
minIdle: 10
# 配置获取连接等待超时的时间
connectionTimeout: 30000
# 校验超时时间
validationTimeout: 5000
# 空闲连接存活最大时间,默认10分钟
idleTimeout: 600000
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
maxLifetime: 1800000
# 多久检查一次连接的活性
keepaliveTime: 30000
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
#app:
#附件地址,不设置而时默认为项目根目录下的/zsvg/atts
# attpath: C:/vben/att
@@ -0,0 +1,277 @@
--- # 监控中心配置
spring.boot.admin.client:
# 增加客户端开关
enabled: false
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
--- # snail-job 配置
snail-job:
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "vben_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
server:
host: 127.0.0.1
port: 17888
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
namespace: ${spring.profiles.active}
# 随主应用端口漂移
port: 2${server.port}
# 客户端ip指定
host:
--- # 数据源配置
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
dynamic:
# 性能分析插件(有性能损耗 不建议生产环境使用)
p6spy: true
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
# 严格模式 匹配不到数据源则报错
strict: true
datasource:
# 主库数据源
master:
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/vben-java?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# # 从库数据源
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username:
# password:
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@//localhost:1521/XE
# username: ROOT
# password: root
# postgres:
# type: ${spring.datasource.type}
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: root
# password: root
# sqlserver:
# type: ${spring.datasource.type}
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
# username: SA
# password: root
hikari:
# 最大连接池数量
maxPoolSize: 20
# 最小空闲线程数量
minIdle: 10
# 配置获取连接等待超时的时间
connectionTimeout: 30000
# 校验超时时间
validationTimeout: 5000
# 空闲连接存活最大时间,默认10分钟
idleTimeout: 600000
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
maxLifetime: 1800000
# 多久检查一次连接的活性
keepaliveTime: 30000
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
redis:
# 地址
host: localhost
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# redis 密码必须配置
# password: vben
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl.enabled: false
# redisson 配置
redisson:
# redis key前缀
keyPrefix:
# 线程池数量
threads: 4
# Netty线程池数量
nettyThreads: 8
# 单节点配置
singleServerConfig:
# 客户端名称 不能用中文
clientName: vben-admin
# 最小空闲连接数
connectionMinimumIdleSize: 8
# 连接池大小
connectionPoolSize: 32
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
--- # mail 邮件发送
mail:
enabled: false
host: smtp.163.com
port: 465
# 是否需要用户名密码验证
auth: true
# 发送方,遵循RFC-822标准
from: xxx@163.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user: xxx@163.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass: xxxxxxxxxx
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
starttlsEnable: true
# 使用SSL安全连接
sslEnable: true
# SMTP超时时长,单位毫秒,缺省值不超时
timeout: 0
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
sms:
# 配置源类型用于标定配置来源(interface,yaml)
config-type: yaml
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
restricted: true
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
minute-max: 1
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
account-max: 30
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
blends:
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
config1:
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: alibaba
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
access-key-id: 您的accessKey
# 称为accessSecret有些称之为apiSecret
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
config2:
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
supplier: tencent
access-key-id: 您的accessKey
access-key-secret: 您的accessKeySecret
signature: 您的短信签名
sdk-app-id: 您的sdkAppId
--- # 三方授权
justauth:
# 前端外网访问地址
address: http://localhost:5666
type:
maxkey:
# maxkey 服务器地址
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
server-url: http://sso.maxkey.top
client-id: 876892492581044224
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
redirect-uri: ${justauth.address}/social-callback?source=maxkey
topiam:
# topiam 服务器地址
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
client-id: 449c4*********937************759
client-secret: ac7***********1e0************28d
redirect-uri: ${justauth.address}/social-callback?source=topiam
scopes: [openid, email, phone, profile]
qq:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=qq
union-id: false
weibo:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=weibo
gitee:
client-id: d46cb33b700cc826680192caa8eda499235a766a96f8a06c16f5ae3da74ce55a
client-secret: 680c9d423de5e264f465b9d9741e79a0363020889abcdfa933993a5d140d95b3
redirect-uri: ${justauth.address}/#/social-callback?source=gitee
dingtalk:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
baidu:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=baidu
csdn:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=csdn
coding:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=coding
coding-group-name: xx
oschina:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=oschina
alipay_wallet:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
alipay-public-key: MIIB**************DAQAB
wechat_open:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
wechat_mp:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
wechat_enterprise:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
agent-id: 1000002
gitlab:
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitlab
gitea:
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
# gitea 服务器地址
server-url: https://demo.gitea.com
client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea
--- # 其他设置
app:
# 前端外网访问地址
attpath: C:/vben/att
# attpath: /home/app/att
@@ -0,0 +1,267 @@
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
# undertow 配置
undertow:
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
threads:
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
io: 8
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
worker: 256
captcha:
# 是否启用验证码校验
enable: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 日志配置
logging:
level:
vben: @logging.level@
org.springframework: warn
org.mybatis.spring.mapper: error
org.apache.fury: warn
config: classpath:logback.xml
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间(默认10分钟)
lockTime: 10
# Spring配置
spring:
application:
name: vben-admin
threads:
# 开启虚拟线程 仅jdk21可用
virtual:
enabled: true
task:
execution:
# 从 springboot 3.5 开始 spring自带线程池
# 不再需要 AsyncConfig与ThreadPoolConfig 可直接注入线程池使用
thread-name-prefix: async-
# 由spring自己初始化线程池
mode: force
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: @profiles.active@
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
mvc:
# 设置静态资源路径 防止所有请求都去查静态资源
static-path-pattern: /static/**
format:
date-time: yyyy-MM-dd HH:mm:ss
jackson:
# 日期格式化
date-format: yyyy-MM-dd HH:mm:ss
serialization:
# 格式化输出
indent_output: false
# 忽略无法转换的对象
fail_on_empty_beans: false
deserialization:
# 允许对象忽略json中不存在的属性
fail_on_unknown_properties: false
# Sa-Token配置
sa-token:
# token名称 (同时也是cookie名称)
token-name: Authorization
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
is-share: false
# jwt秘钥
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
# security配置
security:
# 排除路径
excludes:
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /favicon.ico
- /error
- /*/api-docs
- /*/api-docs/**
- /warm-flow-ui/config
# 多租户配置
tenant:
# 是否开启
enable: true
# 排除表
excludes:
- sys_menu
- sys_tenant
- sys_tenant_package
- sys_role_dept
- sys_role_menu
- sys_user_post
- sys_user_role
- sys_client
- sys_oss_config
- flow_spel
# MyBatisPlus配置
# https://baomidou.com/config/
mybatis-plus:
# 自定义配置 是否全局开启逻辑删除 关闭后 所有逻辑删除功能将失效
enableLogicDelete: true
# 多包名使用 例如 vben.**.mapper,org.xxx.**.mapper
mapperPackage: vben.**.mapper
# 对应的 XML 文件位置
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: vben.**.domain
global-config:
dbConfig:
# 主键类型
# AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
# 如需改为自增 需要将数据库表全部设置为自增
idType: ASSIGN_ID
# 数据加密
mybatis-encryptor:
# 是否开启加密
enable: false
# 默认加密算法
algorithm: BASE64
# 编码方式 BASE64/HEX。默认BASE64
encode: BASE64
# 安全秘钥 对称算法的秘钥 如:AES,SM4
password:
# 公私钥 非对称算法的公私钥 如:SM2,RSA
publicKey:
privateKey:
# api接口加密
api-decrypt:
# 是否开启全局接口加密
enabled: true
# AES 加密头标识
headerFlag: encrypt-key
# 响应加密公钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端解密私钥 MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnNwrj4hi/y3CCJu868ghCG5dUj8wZK++RNlTLcXoMmdZWEQ/u02RgD5LyLAXGjLOjbMtC+/J9qofpSGTKSx/MCAwEAAQ==
# 请求解密私钥 非对称算法的公私钥 如:SM2,RSA 使用者请自行更换
# 对应前端加密公钥 MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
privateKey: MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=
springdoc:
api-docs:
# 是否开启接口文档
enabled: true
info:
# 标题
title: '标题:vben-admin后台管理系统_接口文档'
# 描述
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
# 版本
version: '版本号: ${project.version}'
# 作者信息
contact:
name: baby_fox
email: 676948472@qq.com
url: https://gitee.com/vben/vben-java
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
- group: 1.自定义应用
packages-to-scan: vben.admin
- group: 2.系统管理
packages-to-scan: vben.base.sys
- group: 3.监控中心
packages-to-scan: vben.base.mon
- group: 4.辅助工具
packages-to-scan: vben.base.tool
- group: 5.工作流
packages-to-scan: vben.wf
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接
excludeUrls:
- /system/notice
- /oa/flow/tmpl
- /wf/bus/tmpl
--- # 分布式锁 lock4j 全局配置
lock4j:
# 获取分布式锁超时时间,默认为 3000 毫秒
acquire-timeout: 3000
# 分布式锁的超时时间,默认为 30 秒
expire: 30000
--- # Actuator 监控端点的配置项
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
logfile:
external-file: ./logs/sys-console.log
--- # 默认/推荐使用sse推送
sse:
enabled: true
path: /resource/sse
--- # websocket
websocket:
# 如果关闭 需要和前端开关一起关闭
enabled: false
# 路径
path: /resource/websocket
# 设置访问源地址
allowedOrigins: '*'
--- # warm-flow工作流配置
warm-flow:
# 是否开启工作流,默认true
enabled: true
# 是否开启设计器ui
ui: true
# 是否显示流程图顶部文字
top-text-show: true
# 是否渲染节点悬浮提示,默认true
node-tooltip: true
# 默认Authorization,如果有多个token,用逗号分隔
token-name: ${sa-token.token-name},clientid
@@ -0,0 +1,13 @@
Application Version: ${revision}
Spring Boot Version: ${spring-boot.version}
8b d8 88 88b d88 88 88
`8b d8' 88 888b d888 88 ,d ""
`8b d8' 88 88`8b d8'88 88 88
`8b d8' 88,dPPYba, ,adPPYba, 8b,dPPYba, 88 `8b d8' 88 8b d8 88,dPPYba, ,adPPYYba, MM88MMM 88 ,adPPYba,
`8b d8' 88P' "8a a8P_____88 88P' `"8a 88 `8b d8' 88 `8b d8' 88P' "8a "" `Y8 88 88 I8[ ""
`8b d8' 88 d8 8PP""""""" 88 88 88 `8b d8' 88 `8b d8' 88 d8 ,adPPPPP88 88 88 `"Y8ba,
`888' 88b, ,a8" "8b, ,aa 88 88 88 `888' 88 `8b,d8' 88b, ,a8" 88, ,88 88, 88 aa ]8I
`8' 8Y"Ybbd8"' `"Ybbd8"' 88 88 88 `8' 88 Y88' 8Y"Ybbd8"' `"8bbdP"Y8 "Y888 88 `"YbbdP"'
d8'
d8'
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
@@ -0,0 +1,62 @@
#错误消息
not.null=* Required fill in
user.jcaptcha.error=Captcha error
user.jcaptcha.expire=Captcha invalid
user.not.exists=Sorry, your account: {0} does not exist
user.password.not.match=User does not exist/Password error
user.password.retry.limit.count=Password input error {0} times
user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes
user.password.delete=Sorry, your account:{0} has been deleted
user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator
role.blocked=Role disabled,please contact administrators
user.logout.success=Exit successful
length.not.valid=The length must be between {min} and {max} characters
user.username.not.blank=Username cannot be blank
user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number
user.username.length.valid=Account length must be between {min} and {max} characters
user.password.not.blank=Password cannot be empty
user.password.length.valid=Password length must be between {min} and {max} characters
user.password.not.valid=* 5-50 characters
user.password.format.valid=Password must contain uppercase, lowercase, digit, and special character
user.email.not.valid=Mailbox format error
user.email.not.blank=Mailbox cannot be blank
user.phonenumber.not.blank=Phone number cannot be blank
user.mobile.phone.number.not.valid=Phone number format error
user.login.success=Login successful
user.register.success=Register successful
user.register.save.error=Failed to save user {0}, The registered account already exists
user.register.error=Register failed, please contact system administrator
user.notfound=Please login again
user.forcelogout=The administrator is forced to exit,please login again
user.unknown.error=Unknown error, please login again
auth.grant.type.error=Auth grant type error
auth.grant.type.blocked=Auth grant type disabled
auth.grant.type.not.blank=Auth grant type cannot be blank
auth.clientid.not.blank=Auth clientid cannot be blank
##文件上传消息
upload.exceed.maxSize=The uploaded file size exceeds the limit file size!<br/>the maximum allowed file size is:{0}MB!
upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters
##权限
no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}]
no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}]
no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}]
no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}]
no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}]
no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}]
repeat.submit.message=Repeat submit is not allowed, please try again later
rate.limiter.message=Visit too frequently, please try again later
sms.code.not.blank=Sms code cannot be blank
sms.code.retry.limit.count=Sms code input error {0} times
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes
email.code.not.blank=Email code cannot be blank
email.code.retry.limit.count=Email code input error {0} times
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes
xcx.code.not.blank=Mini program [code] cannot be blank
social.source.not.blank=Social login platform [source] cannot be blank
social.code.not.blank=Social login platform [code] cannot be blank
social.state.not.blank=Social login platform [state] cannot be blank
##租户
tenant.number.not.blank=Tenant number cannot be blank
tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator
tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator
tenant.expired=Sorry, your tenant has expired. Please contact the administrator.
@@ -0,0 +1,62 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.blank=用户名不能为空
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.register.save.error=保存用户 {0} 失败,注册账号已存在
user.register.error=注册失败,请联系系统管理人员
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
auth.grant.type.error=认证权限类型错误
auth.grant.type.blocked=认证权限类型已禁用
auth.grant.type.not.blank=认证权限类型不能为空
auth.clientid.not.blank=认证客户端id不能为空
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.path" value="./zsvg/logs"/>
<property name="console.log.pattern"
value="%cyan(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-console.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大 1天 -->
<maxHistory>1</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- info异步输出 -->
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_info"/>
</appender>
<!-- error异步输出 -->
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_error"/>
</appender>
<!-- 整合 skywalking 控制台输出 tid -->
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!-- 整合 skywalking 推送采集日志 -->
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console" />
<appender-ref ref="async_info" />
<appender-ref ref="async_error" />
<appender-ref ref="file_console" />
<!-- <appender-ref ref="sky_log"/>-->
</root>
</configuration>
+105
View File
@@ -0,0 +1,105 @@
<?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>vben-apps</artifactId>
<groupId>com.zsvg</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>vben-setup</artifactId>
<description>
数据库初始化
</description>
<dependencies>
<!-- Mysql驱动包 -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- &lt;!&ndash; mp支持的数据库均支持 只需要增加对应的jdbc依赖即可 &ndash;&gt;-->
<!-- &lt;!&ndash; Oracle &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.jdbc</groupId>-->
<!-- <artifactId>ojdbc8</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 兼容oracle低版本 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.oracle.database.nls</groupId>-->
<!-- <artifactId>orai18n</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; PostgreSql &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SqlServer &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
<!-- <artifactId>mssql-jdbc</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.zsvg</groupId>
<artifactId>vben-common-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- skywalking 整合 logback -->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,24 @@
package vben;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
/**
* 启动程序
*
* @author Lion Li
*/
@SpringBootApplication
public class VbenSetup {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(VbenSetup.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ vben-setup初始化完成 ლ(´ڡ`ლ)゙");
System.exit(0);
}
}
@@ -0,0 +1,49 @@
package vben.setup.mon;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
@Entity
@Data
@Table(name = "mon_job_log")
public class MonJobLogEntity {
/**
*主键ID
*/
@Id
private Long id;
/**
*任务名称
*/
@Column(length = 32)
private String name;
/**
*开始时间
*/
@Column(length = 32)
private String sttim;
/**
*结束时间
*/
@Column(length = 32)
private String entim;
/**
*运行结果
*/
@Column(length = 32)
private String ret;
/**
*日志信息
*/
@Column(length = 5000)
private String msg;
}
@@ -0,0 +1,77 @@
package vben.setup.mon;
import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "mon_job_main")
public class MonJobMainEntity
{
/**
*主键ID
*/
@Id
private Long id;
/**
*任务名称
*/
@Column(length = 128, updatable = false)
private String name;
/**
*任务代码
*/
@Column(length = 128, updatable = false)
private String code;
// @Column(length = 32, updatable = false)
@Transient
private String jid;
//
// @Column(length = 32, updatable = false)
@Transient
private String jgroup;
/**
*请求类型
*/
private Integer retyp;
/**
*请求URL
*/
@Column(length = 32, updatable = false)
private String reurl;
/**
*可用标记
*/
private Boolean avtag;
/**
*排序号
*/
private Integer ornum;
/**
*创建时间
*/
@Column(updatable = false)
private Date crtim = new Date();
/**
*执行表达式
*/
@Column(length = 32)
private String cron;
/**
*备注
*/
private String notes;
}
@@ -0,0 +1,101 @@
package vben.setup.mon;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "mon_login_log")
@Schema(description = "登录日志")
public class MonLoginLogEntity {
/**
* 日志主键
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 租户编号
*/
@Column(length = 16)
@Schema(description = "租户编号")
private String tenid;
/**
* 用户账号
*/
@Column(length = 16)
@Schema(description = "用户账号")
private String usnam;
/**
* 客户端
*/
@Column(length = 32)
@Schema(description = "客户端")
private String clkey;
/**
* 设备类型
*/
@Column(length = 8)
@Schema(description = "设备类型")
private String detyp;
/**
* 登录状态 1成功 0失败
*/
@Schema(description = "登录状态")
private Boolean sutag;
/**
* 登录IP地址
*/
@Column(length = 16)
@Schema(description = "登录IP地址")
private String loip;
/**
* 登录地点
*/
@Column(length = 64)
@Schema(description = "登录地点")
private String loloc;
/**
* 浏览器
*/
@Column(length = 64)
@Schema(description = "浏览器")
private String browser;
/**
* 操作系统
*/
@Column(length = 64)
@Schema(description = "操作系统")
private String os;
/**
* 提示消息
*/
@Schema(description = "操作系统")
private String himsg;
/**
* 登录时间
*/
@Schema(description = "登录时间")
private Date lotim;
}
@@ -0,0 +1,139 @@
package vben.setup.mon;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "mon_oper_log")
@Schema(description = "操作日志")
public class MonOperLogEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 租户编号
*/
@Column(length = 16)
@Schema(description = "租户编号")
private String tenid;
/**
* 操作模块
*/
@Column(length = 32)
@Schema(description = "操作模块")
private String opmod;
/**
* 业务类型(0其它 1新增 2修改 3删除)
*/
@Schema(description = "业务类型")
private Integer butyp;
/**
* 请求方法
*/
@Column(length = 64)
@Schema(description = "请求方法")
private String remet;
/**
* 请求方式
*/
@Column(length = 8)
@Schema(description = "请求方式")
private String reway;
/**
* 操作类别(0其它 1后台用户 2手机端用户)
*/
@Schema(description = "操作类别")
private Integer optyp;
/**
* 操作人员
*/
@Column(length = 16)
@Schema(description = "操作人员")
private String opuna;
/**
* 部门名称
*/
@Column(length = 64)
@Schema(description = "操作人员")
private String opdna;
/**
* 请求url
*/
@Column(length = 64)
@Schema(description = "请求url")
private String reurl;
/**
* 操作IP地址
*/
@Column(length = 32)
@Schema(description = "操作IP地址")
private String opip;
/**
* 操作地点
*/
@Column(length = 64)
@Schema(description = "操作地点")
private String oploc;
/**
* 请求参数
*/
@Column(length = 4000)
@Schema(description = "请求参数")
private String repar;
/**
* 返回参数
*/
@Column(length = 4000)
@Schema(description = "返回参数")
private String bapar;
/**
* 操作状态(1成功 0失败)
*/
@Schema(description = "操作状态")
private Boolean sutag;
/**
* 错误消息
*/
@Column(length = 4000)
@Schema(description = "错误消息")
private String ermsg;
/**
* 操作时间
*/
@Schema(description = "操作时间")
private Date optim;
/**
* 消耗时间
*/
@Schema(description = "消耗时间")
private Long cotim;
}
@@ -0,0 +1,26 @@
package vben.setup.root;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* 数据初始化
*
*/
@Slf4j
@RequiredArgsConstructor
@Component
public class DataInitRunner implements ApplicationRunner {
private final DataInitService dataInitService;
@Override
public void run(ApplicationArguments args) throws Exception {
dataInitService.init();
log.info("数据初始化");
}
}
@@ -0,0 +1,81 @@
package vben.setup.root;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jdbc.sqler.JdbcHelper;
import vben.setup.sys.config.SysConfigInitService;
import vben.setup.sys.notice.SysNoticeInitService;
import vben.setup.sys.org.dept.SysOrgDeptInitService;
import vben.setup.sys.org.group.SysOrgGroupInitService;
import vben.setup.sys.org.post.SysOrgPostInitService;
import vben.setup.sys.org.user.SysOrgUserInitService;
import vben.setup.sys.perm.api.SysPermApiInitService;
import vben.setup.sys.perm.menu.SysPermMenuInitService;
import vben.setup.sys.perm.role.SysPermRoleInitService;
import vben.setup.tool.dict.ToolDictInitService;
import vben.setup.tool.num.ToolNumInitService;
import vben.setup.wf.bus.WfBusInitService;
/**
* 数据初始化
*/
@Service
@RequiredArgsConstructor
public class DataInitService {
public void init() {
String sql="select count(1) from sys_org where id='u1'";
Integer count = jdbcHelper.getTp().queryForObject(sql, Integer.class);
if(count!=null&&count!=0){
return;
}
//1为机构,2为部门,4为岗位,8为用户,16为常用群组,32为流程组织角色
deptInitService.init();
userInitService.init();
postInitService.init();
groupInitService.init();
menuInitService.initBase();
menuInitService.initWf();
apiInitService.initBase();
apiInitService.initWf();
roleInitService.init();
configInitService.init();
noticeInitService.init();
dictInitService.init();
numInitService.init();
//流程相关数据
wfBusInitService.init();
}
private final JdbcHelper jdbcHelper;
private final SysOrgDeptInitService deptInitService;
private final SysOrgUserInitService userInitService;
private final SysOrgPostInitService postInitService;
private final SysOrgGroupInitService groupInitService;
private final SysPermMenuInitService menuInitService;
private final SysPermApiInitService apiInitService;
private final SysPermRoleInitService roleInitService;
private final SysConfigInitService configInitService;
private final SysNoticeInitService noticeInitService;
private final ToolDictInitService dictInitService;
private final ToolNumInitService numInitService;
private final WfBusInitService wfBusInitService;
}
@@ -0,0 +1,78 @@
package vben.setup.sys.config;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "sys_config")
@Schema(description = "系统参数")
public class SysConfigEntity {
/**
* 参数主键
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 参数名称
*/
@Column(length = 32)
@Schema(description = "参数名称")
private String name;
/**
* 参数键名
*/
@Column(length = 32)
@Schema(description = "参数键名")
private String kenam;
/**
* 参数键值
*/
@Column(length = 32)
@Schema(description = "参数键值")
private String keval;
/**
* 内置标记
*/
private Boolean intag;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 创建时间
*/
private Date crtim = new Date();
/**
* 更新时间
*/
private Date uptim;
/**
* 可用标记
*/
private Boolean avtag;
/**
* 排序号
*/
private Integer ornum;
}
@@ -0,0 +1,53 @@
package vben.setup.sys.config;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysConfigInitService {
public void init() {
List<SysConfigEntity> list = new ArrayList<>();
SysConfigEntity c1 = new SysConfigEntity();
c1.setId(1L);
c1.setName("用户管理-账号初始密码");
c1.setKenam("sys.user.initPassword");
c1.setKeval("123456");
c1.setIntag(true);
list.add(c1);
SysConfigEntity c2 = new SysConfigEntity();
c2.setId(2L);
c2.setName("账号自助-是否开启用户注册功能");
c2.setKenam("sys.account.registerUser");
c2.setKeval("false");
c2.setIntag(true);
list.add(c2);
insert(list);
}
private final SysConfigRepo repo;
private void insert(List<SysConfigEntity> list) {
for (SysConfigEntity config : list) {
config.setCrtim(new Date());
config.setUptim(config.getCrtim());
config.setAvtag(true);
}
repo.saveAll(list);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.config;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysConfigRepo extends JpaRepository<SysConfigEntity,String> {
}
@@ -0,0 +1,80 @@
package vben.setup.sys.notice;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 通知公告 sys_notice
*
*/
@Data
@Entity
@Table(name = "sys_notice")
@Schema(description = "通知公告")
public class SysNoticeEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 公告标题
*/
@Column(length = 64)
@Schema(description = "公告标题")
private String name;
/**
* 公告内容
*/
@Column(length = 2000)
@Schema(description = "公告内容")
private String content;
/**
* 公告类型(1通知 2公告)
*/
@Schema(description = "公告类型(1通知 2公告)")
private Integer type;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
}
@@ -0,0 +1,44 @@
package vben.setup.sys.notice;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysNoticeInitService {
public void init() {
List<SysNoticeEntity> list = new ArrayList<>();
SysNoticeEntity n1 = new SysNoticeEntity();
n1.setId(1L);
n1.setName("系统停机公告");
n1.setContent("系统将于今天晚上20点到22点进行停机维护,请提前做好工作安排");
n1.setOrnum(1);
n1.setType(1);
list.add(n1);
insert(list);
}
private final SysNoticeRepo repo;
private void insert(List<SysNoticeEntity> list) {
for (SysNoticeEntity notice : list) {
notice.setCrtim(new Date());
notice.setUptim(notice.getCrtim());
notice.setAvtag(true);
}
repo.saveAll(list);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.notice;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysNoticeRepo extends JpaRepository<SysNoticeEntity,String> {
}
@@ -0,0 +1,138 @@
package vben.setup.sys.org.dept;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 组织架构部门
*/
@Data
@Entity
@Table(name = "sys_org_dept")
@Schema(description = "组织架构-部门")
public class SysOrgDeptEntity {
/**
* 主键ID
*/
@Id
@Column(length = 36)
@Schema(description = "主键ID")
private String id;
/**
* 名称
*/
@Column(length = 64)
@Schema(description = "名称")
private String name;
/**
* 父ID
*/
@Column(length = 36)
@Schema(description = "父ID")
private String pid;
/**
* 部门类型
* 部门在整个组织架构sys_org表中类别为1,这个字段是进行部门细分的,比如分为集团、企业、机构、部门等
*/
@Schema(description = "部门类型")
private Integer type;
/**
* 层级,建议不超过10级
*/
@Column(length = 512)
@Schema(description = "层级")
private String tier;
/**
* 标签
*/
@Column(length = 32)
@Schema(description = "标签")
private String label;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 32)
@Schema(description = "创建人ID")
private String cruid;
/**
* 更新人ID
*/
@Column(length = 32)
@Schema(description = "更新人ID")
private String upuid;
/**
* 自定义扩展字段1
*/
@Column(length = 32)
@Schema(description = "扩展字段1")
private String ex1;
/**
* 自定义扩展字段2
*/
@Column(length = 32)
@Schema(description = "扩展字段2")
private String ex2;
/**
* 自定义扩展字段3
*/
@Column(length = 32)
@Schema(description = "扩展字段3")
private String ex3;
/**
* 自定义扩展字段4
*/
@Column(length = 32)
@Schema(description = "扩展字段4")
private String ex4;
}
@@ -0,0 +1,172 @@
package vben.setup.sys.org.dept;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.org.root.SysOrgRepo;
import java.util.ArrayList;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysOrgDeptInitService {
public void init() {
List<SysOrgDeptEntity> list=new ArrayList<>();
SysOrgDeptEntity dept = new SysOrgDeptEntity();
dept.setId("d1000");
dept.setName("维本科技");
dept.setType(1);
dept.setTier("d1000");
list.add(dept);
SysOrgDeptEntity dept1100 = new SysOrgDeptEntity();
dept1100.setId("d1100");
dept1100.setName("北京分公司");
dept1100.setType(2);
dept1100.setPid("d1000");
dept1100.setTier("d1000_d1100");
list.add(dept1100);
SysOrgDeptEntity dept1110 = new SysOrgDeptEntity();
dept1110.setId("d1110");
dept1110.setName("北京分公司销售部");
dept1110.setType(8);
dept1110.setPid("d1100");
dept1110.setTier("d1000_d1100_d1110");
list.add(dept1110);
SysOrgDeptEntity dept1111 = new SysOrgDeptEntity();
dept1111.setId("d1111");
dept1111.setName("北京分公司销售部一组");
dept1111.setType(8);
dept1111.setPid("d1110");
dept1111.setTier("d1000_d1100_d1110_d1111");
list.add(dept1111);
SysOrgDeptEntity dept1112 = new SysOrgDeptEntity();
dept1112.setId("d1112");
dept1112.setName("北京分公司销售部二组");
dept1112.setType(8);
dept1112.setPid("d1110");
dept1112.setTier("d1000_d1100_d1110_d1112");
list.add(dept1112);
SysOrgDeptEntity dept1120 = new SysOrgDeptEntity();
dept1120.setId("d1120");
dept1120.setName("北京分公司人事部");
dept1120.setType(8);
dept1120.setPid("d1100");
dept1120.setTier("d1000_d1100_d1120;");
list.add(dept1120);
SysOrgDeptEntity dept1130 = new SysOrgDeptEntity();
dept1130.setId("d1130");
dept1130.setName("北京分公司财务部");
dept1130.setType(8);
dept1130.setPid("d1100");
dept1130.setTier("d1000_d1100_d1130");
list.add(dept1130);
SysOrgDeptEntity dept1140 = new SysOrgDeptEntity();
dept1140.setId("d1140");
dept1140.setName("北京分公司综合部");
dept1140.setType(8);
dept1140.setPid("d1100");
dept1140.setTier("d1000_d1100_d1410");
list.add(dept1140);
SysOrgDeptEntity dept1200 = new SysOrgDeptEntity();
dept1200.setId("d1200");
dept1200.setName("上海分公司");
dept1200.setType(2);
dept1200.setPid("d1000");
dept1200.setTier("d1000_d1200");
list.add(dept1200);
SysOrgDeptEntity dept1210 = new SysOrgDeptEntity();
dept1210.setId("d1210");
dept1210.setName("上海分公司销售部");
dept1210.setType(8);
dept1210.setPid("d1200");
dept1210.setTier("d1000_d1200_d1210");
list.add(dept1210);
SysOrgDeptEntity dept1220 = new SysOrgDeptEntity();
dept1220.setId("d1220");
dept1220.setName("上海分公司人事部");
dept1220.setType(8);
dept1220.setPid("d1200");
dept1220.setTier("d1000_d1200_d1220");
list.add(dept1220);
SysOrgDeptEntity dept1230 = new SysOrgDeptEntity();
dept1230.setId("d1230");
dept1230.setName("上海分公司财务部");
dept1230.setType(8);
dept1230.setPid("d1200");
dept1230.setTier("d1000_d1200_d1230");
list.add(dept1230);
SysOrgDeptEntity dept1300 = new SysOrgDeptEntity();
dept1300.setId("d1300");
dept1300.setName("广州分公司");
dept1300.setType(2);
dept1300.setPid("d1000");
dept1300.setTier("d1000_d1300");
list.add(dept1300);
SysOrgDeptEntity dept1310 = new SysOrgDeptEntity();
dept1310.setId("d1310");
dept1310.setName("广州分公司综合部");
dept1310.setType(8);
dept1310.setPid("d1300");
dept1310.setTier("d1000_d1300_d1310");
list.add(dept1310);
SysOrgDeptEntity dept1320 = new SysOrgDeptEntity();
dept1320.setId("d1320");
dept1320.setName("广州分公司销售部");
dept1320.setType(8);
dept1320.setPid("d1300");
dept1320.setTier("d1000_d1300_d1320");
list.add(dept1320);
SysOrgDeptEntity dept1330 = new SysOrgDeptEntity();
dept1330.setId("d1330");
dept1330.setName("广州分公司人事部");
dept1330.setType(8);
dept1330.setPid("d1300");
dept1330.setTier("d1000_d1300_d1330");
list.add(dept1330);
insert(list);
}
private final SysOrgDeptRepo deptRepo;
private final SysOrgRepo orgRepo;
private void insert(List<SysOrgDeptEntity> list) {
List<SysOrg> list2 = new ArrayList<>();
for (SysOrgDeptEntity dept : list) {
dept.setAvtag(true);
dept.setOrnum(Integer.parseInt(dept.getId().substring(1)));
SysOrg org = new SysOrg();
org.setId(dept.getId());
org.setName(dept.getName());
org.setType(1);
list2.add(org);
}
deptRepo.saveAll(list);
orgRepo.saveAll(list2);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.org.dept;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysOrgDeptRepo extends JpaRepository<SysOrgDeptEntity,String> {
}
@@ -0,0 +1,47 @@
package vben.setup.sys.org.group;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
/**
* 群组分类
*/
@Data
@Entity
@Table(name = "sys_org_group_cate")
@Schema(description = "组织架构-群组分类")
public class SysOrgGroupCateEntity {
/**
* 主键ID
*/
@Id
@Column(length = 32)
@Schema(description = "主键ID")
private String id;
/**
* 名称
*/
@Schema(description = "名称")
private String name;
/**
* 父ID
*/
@Column(length = 32)
@Schema(description = "父ID")
private String pid;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
}
@@ -0,0 +1,102 @@
package vben.setup.sys.org.group;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import vben.common.jpa.entity.SysOrg;
import java.util.Date;
import java.util.List;
/**
* 组织架构群组
*/
@Data
@Entity
@Table(name = "sys_org_group")
@Schema(description = "组织架构-群组")
public class SysOrgGroupEntity {
/**
* 主键ID
*/
@Id
@Column(length = 36)
@Schema(description = "主键ID")
private String id;
/**
* 名称
*/
@Column(length = 64)
@Schema(description = "名称")
private String name;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 分类ID
*/
@Column(length = 36)
@Schema(description = "分类ID")
private String catid;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 标签
*/
@Column(length = 32)
@Schema(description = "标签")
private String label;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim=new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 32)
@Schema(description = "创建人ID")
private String cruid;
/**
* 更新人ID
*/
@Column(length = 32)
@Schema(description = "更新人ID")
private String upuid;
/**
* 成员列表
*/
@ManyToMany
@JoinTable(name = "sys_org_group_org", joinColumns = {@JoinColumn(name = "gid")},
inverseJoinColumns = {@JoinColumn(name = "oid")})
@Schema(description = "成员信息")
private List<SysOrg> members;
}
@@ -0,0 +1,48 @@
package vben.setup.sys.org.group;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.org.root.SysOrgRepo;
import java.util.List;
/**
* 群组初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysOrgGroupInitService {
public void init() {
SysOrgGroupEntity group= new SysOrgGroupEntity();
group.setId("g3001");
group.setName("北京分公司管理组");
group.setMembers(List.of(new SysOrg("u4"),new SysOrg("u5"),new SysOrg("p2004"),new SysOrg("d1140")));
insert(group);
SysOrgGroupEntity group2= new SysOrgGroupEntity();
group2.setId("g3002");
group2.setName("北京分公司销售员");
group2.setMembers(List.of(new SysOrg("u8"),new SysOrg("u9")));
insert(group2);
}
private final SysOrgGroupRepo groupRepo;
private final SysOrgRepo orgRepo;
private void insert(SysOrgGroupEntity group) {
group.setAvtag(true);
group.setOrnum(Integer.parseInt(group.getId().substring(1)));
groupRepo.save(group);
SysOrg org = new SysOrg();
org.setId(group.getId());
org.setName(group.getName());
org.setType(8);
orgRepo.save(org);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.org.group;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysOrgGroupRepo extends JpaRepository<SysOrgGroupEntity,String> {
}
@@ -0,0 +1,109 @@
package vben.setup.sys.org.post;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import vben.common.jpa.entity.SysOrg;
import java.util.Date;
import java.util.List;
/**
* 组织架构岗位
*/
@Data
@Entity
@Table(name = "sys_org_post")
@Schema(description = "组织架构-岗位")
public class SysOrgPostEntity {
/**
* 主键ID
*/
@Id
@Column(length = 36)
@Schema(description = "主键ID")
private String id;
/**
* 名称
*/
@Column(length = 64)
@Schema(description = "名称")
private String name;
/**
* 部门ID
*/
@Column(length = 36)
@Schema(description = "部门ID")
private String depid;
/**
* 层级,以“_”隔开
*/
@Column(length = 512)
@Schema(description = "层级")
private String tier;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 标签
*/
@Column(length = 32)
@Schema(description = "标签")
private String label;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 36)
@Schema(description = "创建人ID")
private String cruid;
/**
* 更新人ID
*/
@Column(length = 36)
@Schema(description = "更新人ID")
private String upuid;
/**
* 包含成员
*/
@ManyToMany
@JoinTable(name = "sys_org_post_org", joinColumns = {@JoinColumn(name = "pid")},
inverseJoinColumns = {@JoinColumn(name = "oid")})
@Schema(description = "员工列表")
private List<SysOrg> users;
}
@@ -0,0 +1,71 @@
package vben.setup.sys.org.post;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.org.root.SysOrgRepo;
import java.util.List;
/**
* 岗位初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysOrgPostInitService {
public void init() {
SysOrgPostEntity post1 = new SysOrgPostEntity();
post1.setId("p2001");
post1.setName("董事长");
post1.setUsers(List.of(new SysOrg("u3")));
post1.setDepid("d1000");
post1.setTier("d1000_p2001");
insert(post1);
SysOrgPostEntity post2 = new SysOrgPostEntity();
post2.setId("p2002");
post2.setName("北京分公司总经理");
post2.setUsers(List.of(new SysOrg("u4")));
post2.setDepid("d1100");
post2.setTier("d1000_d1100_p2002");
insert(post2);
SysOrgPostEntity post3 = new SysOrgPostEntity();
post3.setId("p2003");
post3.setName("北京分公司销售部长");
post3.setUsers(List.of(new SysOrg("u5")));
post3.setDepid("d1110");
post3.setTier("d1000_d1100_d1110_p2003");
insert(post3);
SysOrgPostEntity post4 = new SysOrgPostEntity();
post4.setId("p2004");
post4.setName("北京分公司销售经理");
post4.setUsers(List.of(new SysOrg("u6"),new SysOrg("u7")));
post4.setDepid("d1111");
post4.setTier("d1000_d1100_d1110_d1111_p2004");
insert(post4);
}
private final SysOrgPostRepo postRepo;
private final SysOrgRepo orgRepo;
private void insert(SysOrgPostEntity post) {
post.setAvtag(true);
post.setOrnum(Integer.parseInt(post.getId().substring(1)));
postRepo.save(post);
SysOrg org = new SysOrg();
org.setId(post.getId());
org.setName(post.getName());
org.setType(4);
orgRepo.save(org);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.org.post;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysOrgPostRepo extends JpaRepository<SysOrgPostEntity,String> {
}
@@ -0,0 +1,48 @@
package vben.setup.sys.org.rece;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 组织架构最近访问记录
*/
@Data
@Entity
@Table(name = "sys_org_rece")
@Schema(description = "组织架构-最近访问记录")
public class SysOrgReceEntity {
/**
* 主键ID
*/
@Id
@Column(length = 36)
@Schema(description = "主键ID")
private String id;
/**
* 用户ID
*/
@Column(length = 36)
@Schema(description = "用户ID")
private String uid;
/**
* 最近使用的组织架构ID
*/
@Column(length = 36)
@Schema(description = "最近使用的组织架构ID")
private String oid;
/**
* 最近使用时间
*/
@Schema(description = "最近使用的组织架构ID")
private Date uptim = new Date();
}
@@ -0,0 +1,9 @@
package vben.setup.sys.org.root;
import org.springframework.data.jpa.repository.JpaRepository;
import vben.common.jpa.entity.SysOrg;
public interface SysOrgRepo extends JpaRepository<SysOrg,String> {
}
@@ -0,0 +1,210 @@
package vben.setup.sys.org.user;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 组织架构用户
*/
@Data
@Entity
@Table(name = "sys_org_user")
@Schema(description = "组织架构-用户")
public class SysOrgUserEntity {
/**
* 主键ID
*/
@Id
@Column(length = 36)
@Schema(description = "主键ID")
private String id;
/**
* 姓名
*/
@Column(length = 16)
@Schema(description = "姓名")
private String name;
/**
* 自定义昵称
*/
@Column(length = 16)
@Schema(description = "昵称")
private String ninam;
/**
* 部门ID
*/
@Column(length = 36)
@Schema(description = "部门ID")
private String depid;
/**
* 层级,建议不超过10级
*/
@Column(length = 512)
@Schema(description = "层级")
private String tier;
/**
* 职务
*/
@Column(length = 64)
@Schema(description = "职务")
private String job;
/**
* 登录名
*/
@Column(length = 32)
@Schema(description = "登录名")
private String usnam;
/**
* 密码
*/
@Column(length = 64)
@Schema(description = "密码")
private String pacod;
/**
* 邮箱
*/
@Column(length = 32)
@Schema(description = "邮箱")
private String email;
/**
* 性别
*/
@Column(length = 8)
@Schema(description = "性别")
private String sex;
/**
* 手机号
*/
@Column(length = 16)
@Schema(description = "手机号")
private String monum;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 标签
*/
@Column(length = 32)
@Schema(description = "标签")
private String label;
/**
* 备注
*/
@Schema(description = "notes")
private String notes;
/**
* 缓存标记
*/
@Schema(description = "缓存标记")
private Boolean catag = false;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 32)
@Schema(description = "创建人ID")
private String cruid;
/**
* 更新人ID
*/
@Column(length = 32)
@Schema(description = "更新人ID")
private String upuid;
/**
* 头像url
*/
@Schema(description = "头像url")
@Column(length = 128)
private String avatar;
/**
* 登录IP
*/
@Column(length = 20)
@Schema(description = "登录IP")
private String loip;
/**
* 登录时间
*/
@Schema(description = "登录时间")
private Date lotim;
/**
* 用户类别
*/
@Schema(description = "用户类别")
private Integer type;
/**
* 自定义扩展字段1
*/
@Column(length = 32)
@Schema(description = "扩展字段1")
private String ex1;
/**
* 自定义扩展字段2
*/
@Column(length = 32)
@Schema(description = "扩展字段2")
private String ex2;
/**
* 自定义扩展字段3
*/
@Column(length = 32)
@Schema(description = "扩展字段3")
private String ex3;
/**
* 自定义扩展字段4
*/
@Column(length = 32)
@Schema(description = "扩展字段4")
private String ex4;
}
@@ -0,0 +1,127 @@
package vben.setup.sys.org.user;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.org.root.SysOrgRepo;
import java.util.ArrayList;
import java.util.List;
/**
* 用户初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysOrgUserInitService {
public void init() {
List<SysOrgUserEntity> list = new ArrayList<>();
SysOrgUserEntity user = new SysOrgUserEntity();
user.setId("u1");
user.setName("管理员");
user.setUsnam("admin");
user.setDepid("d1000");
user.setTier("d1000_u1");
user.setMonum("13812345678");
user.setEmail("admin@qq.com");
user.setSex("1");
user.setNotes("管理员不给修改");
list.add(user);
SysOrgUserEntity user2 = new SysOrgUserEntity();
user2.setId("u2");
user2.setName("小狐狸");
user2.setUsnam("vben");
user2.setDepid("d1000");
user2.setTier("d1000_u2");
user2.setMonum("13912345678");
user.setEmail("vben@qq.com");
user2.setSex("2");
list.add(user2);
SysOrgUserEntity user3 = new SysOrgUserEntity();
user3.setId("u3");
user3.setName("张三");
user3.setUsnam("zs");
user3.setDepid("d1000");
user3.setTier("d1000_u3");
list.add(user3);
SysOrgUserEntity user4 = new SysOrgUserEntity();
user4.setId("u4");
user4.setName("李四");
user4.setUsnam("ls");
user4.setDepid("d1100");
user4.setTier("d1000_d1100_u4");
list.add(user4);
SysOrgUserEntity user5 = new SysOrgUserEntity();
user5.setId("u5");
user5.setName("王五");
user5.setUsnam("ww");
user5.setDepid("d1110");
user5.setTier("d1000_d1100_d1110_u5");
list.add(user5);
SysOrgUserEntity user6 = new SysOrgUserEntity();
user6.setId("u6");
user6.setName("赵六");
user6.setUsnam("zl");
user6.setDepid("d1111");
user6.setTier("d1000_d1100_d1110_d1111_u6");
list.add(user6);
SysOrgUserEntity user7 = new SysOrgUserEntity();
user7.setId("u7");
user7.setName("孙七");
user7.setUsnam("sq");
user7.setDepid("d1111");
user7.setTier("d1000_d1100_d1110_d1111_u7");
list.add(user7);
SysOrgUserEntity user8 = new SysOrgUserEntity();
user8.setId("u8");
user8.setName("周八");
user8.setUsnam("zb");
user8.setDepid("d1111");
user8.setTier("d1000_d1100_d1110_d1111_u8");
list.add(user8);
SysOrgUserEntity user9 = new SysOrgUserEntity();
user9.setId("u9");
user9.setName("吴九");
user9.setUsnam("wj");
user9.setDepid("d1111");
user9.setTier("d1000_d1100_d1110_d1111_u9");
list.add(user9);
insert(list);
}
private final SysOrgUserRepo userRepo;
private final SysOrgRepo orgRepo;
private void insert(List<SysOrgUserEntity> list) {
List<SysOrg> list2=new ArrayList<>();
for (SysOrgUserEntity user : list) {
user.setAvtag(true);
user.setNinam(user.getName());
user.setPacod("$2a$10$09f8rxsX4tbj1CZla2MSOuiwHwp5QAPUzbp5whnoZEFK4/xplNwZq");
user.setOrnum(Integer.parseInt(user.getId().substring(1)));
SysOrg org = new SysOrg();
org.setId(user.getId());
org.setName(user.getName());
org.setType(2);
list2.add(org);
}
userRepo.saveAll(list);
orgRepo.saveAll(list2);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.org.user;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysOrgUserRepo extends JpaRepository<SysOrgUserEntity,String> {
}
@@ -0,0 +1,102 @@
package vben.setup.sys.perm.api;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "sys_perm_api")
@Schema(description = "权限接口")
public class SysPermApiEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 接口名称
*/
@Column(length = 32)
@Schema(description = "名称")
private String name;
/**
* 菜单ID
*/
@Schema(description = "菜单ID")
private Long menid;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 权限字符
*/
@Column(length = 64)
@Schema(description = "权限字符")
private String perm;
/**
* 权限代码
*/
@Schema(description = "权限代码")
private Long code;
/**
* 权限位
*/
@Schema(description = "权限位")
private Integer pos;
/**
* 权限类型
*/
@Column(length = 8)
@Schema(description = "权限类型")
private String type;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
public SysPermApiEntity() {
}
public SysPermApiEntity(Long id) {
this.id = id;
}
}
@@ -0,0 +1,497 @@
package vben.setup.sys.perm.api;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysPermApiInitService {
public void initBase() {
List<SysPermApiEntity> list = new ArrayList<>();
SysPermApiEntity a101001 = new SysPermApiEntity();
a101001.setId(101001L);
a101001.setOrnum(101001);
a101001.setName("部门查询");
a101001.setMenid(1010L);
a101001.setPerm("sysorg:dept:query");
list.add(a101001);
SysPermApiEntity a101002 = new SysPermApiEntity();
a101002.setId(101002L);
a101002.setOrnum(101002);
a101002.setName("部门编辑");
a101002.setMenid(1010L);
a101002.setPerm("sysorg:dept:edit");
list.add(a101002);
SysPermApiEntity a101003 = new SysPermApiEntity();
a101003.setId(101003L);
a101003.setOrnum(101003);
a101003.setName("部门删除");
a101003.setMenid(1010L);
a101003.setPerm("sysorg:dept:delete");
list.add(a101003);
SysPermApiEntity a102001 = new SysPermApiEntity();
a102001.setId(102001L);
a102001.setOrnum(102001);
a102001.setName("用户查询");
a102001.setMenid(1020L);
a102001.setPerm("sysorg:user:query");
list.add(a102001);
SysPermApiEntity a102002 = new SysPermApiEntity();
a102002.setId(102002L);
a102002.setOrnum(102002);
a102002.setName("用户编辑");
a102002.setMenid(1020L);
a102002.setPerm("sysorg:user:edit");
list.add(a102002);
SysPermApiEntity a102003 = new SysPermApiEntity();
a102003.setId(102003L);
a102003.setOrnum(102003);
a102003.setName("用户删除");
a102003.setMenid(1020L);
a102003.setPerm("sysorg:user:delete");
list.add(a102003);
SysPermApiEntity a102004 = new SysPermApiEntity();
a102004.setId(102004L);
a102004.setOrnum(102004);
a102004.setName("用户启用禁用");
a102004.setMenid(1020L);
a102004.setPerm("sysorg:user:avtag");
list.add(a102004);
SysPermApiEntity a102005 = new SysPermApiEntity();
a102005.setId(102005L);
a102005.setOrnum(102005);
a102005.setName("用户密码修改");
a102005.setMenid(1020L);
a102005.setPerm("sysorg:user:pacod");
list.add(a102005);
SysPermApiEntity a103001 = new SysPermApiEntity();
a103001.setId(103001L);
a103001.setOrnum(103001);
a103001.setName("岗位查询");
a103001.setMenid(1030L);
a103001.setPerm("sysorg:post:query");
list.add(a103001);
SysPermApiEntity a103002 = new SysPermApiEntity();
a103002.setId(103002L);
a103002.setOrnum(103002);
a103002.setName("岗位编辑");
a103002.setMenid(1030L);
a103002.setPerm("sysorg:post:edit");
list.add(a103002);
SysPermApiEntity a103003 = new SysPermApiEntity();
a103003.setId(103003L);
a103003.setOrnum(103003);
a103003.setName("岗位删除");
a103003.setMenid(1030L);
a103003.setPerm("sysorg:post:delete");
list.add(a103003);
SysPermApiEntity a104001 = new SysPermApiEntity();
a104001.setId(104001L);
a104001.setOrnum(104001);
a104001.setName("群组查询");
a104001.setMenid(1040L);
a104001.setPerm("sysorg:group:query");
list.add(a104001);
SysPermApiEntity a104002 = new SysPermApiEntity();
a104002.setId(104002L);
a104002.setOrnum(104002);
a104002.setName("群组编辑");
a104002.setMenid(1040L);
a104002.setPerm("sysorg:group:edit");
list.add(a104002);
SysPermApiEntity a104003 = new SysPermApiEntity();
a104003.setId(104003L);
a104003.setOrnum(104003);
a104003.setName("群组删除");
a104003.setMenid(1040L);
a104003.setPerm("sysorg:group:delete");
list.add(a104003);
SysPermApiEntity a104004 = new SysPermApiEntity();
a104004.setId(104004L);
a104004.setOrnum(104004);
a104004.setName("群组分类查询");
a104004.setMenid(1040L);
a104004.setPerm("sysorg:groupc:query");
list.add(a104004);
SysPermApiEntity a104005 = new SysPermApiEntity();
a104005.setId(104005L);
a104005.setOrnum(104005);
a104005.setName("群组分类编辑");
a104005.setMenid(1040L);
a104005.setPerm("sysorg:groupc:edit");
list.add(a104005);
SysPermApiEntity a104006 = new SysPermApiEntity();
a104006.setId(104006L);
a104006.setOrnum(104006);
a104006.setName("群组分类删除");
a104006.setMenid(1040L);
a104006.setPerm("sysorg:groupc:delete");
list.add(a104006);
SysPermApiEntity a105001 = new SysPermApiEntity();
a105001.setId(105001L);
a105001.setOrnum(105001);
a105001.setName("菜单查询");
a105001.setMenid(1050L);
a105001.setPerm("sysperm:menu:query");
list.add(a105001);
SysPermApiEntity a105002 = new SysPermApiEntity();
a105002.setId(105002L);
a105002.setOrnum(105002);
a105002.setName("菜单编辑");
a105002.setMenid(1050L);
a105002.setPerm("sysperm:menu:edit");
list.add(a105002);
SysPermApiEntity a105003 = new SysPermApiEntity();
a105003.setId(105003L);
a105003.setOrnum(105003);
a105003.setName("菜单删除");
a105003.setMenid(1050L);
a105003.setPerm("sysperm:menu:delete");
list.add(a105003);
SysPermApiEntity a106001 = new SysPermApiEntity();
a106001.setId(106001L);
a106001.setOrnum(106001);
a106001.setName("接口查询");
a106001.setMenid(1060L);
a106001.setPerm("sysperm:api:query");
list.add(a106001);
SysPermApiEntity a106002 = new SysPermApiEntity();
a106002.setId(106002L);
a106002.setOrnum(106002);
a106002.setName("接口编辑");
a106002.setMenid(1060L);
a106002.setPerm("sysperm:api:edit");
list.add(a106002);
SysPermApiEntity a106003 = new SysPermApiEntity();
a106003.setId(106003L);
a106003.setOrnum(106003);
a106003.setName("接口删除");
a106003.setMenid(1060L);
a106003.setPerm("sysperm:api:delete");
list.add(a106003);
SysPermApiEntity a107001 = new SysPermApiEntity();
a107001.setId(107001L);
a107001.setOrnum(107001);
a107001.setName("角色查询");
a107001.setMenid(1070L);
a107001.setPerm("sysperm:role:query");
list.add(a107001);
SysPermApiEntity a107002 = new SysPermApiEntity();
a107002.setId(107002L);
a107002.setOrnum(107002);
a107002.setName("角色编辑");
a107002.setMenid(1070L);
a107002.setPerm("sysperm:role:edit");
list.add(a107002);
SysPermApiEntity a107003 = new SysPermApiEntity();
a107003.setId(107003L);
a107003.setOrnum(107003);
a107003.setName("角色删除");
a107003.setMenid(1070L);
a107003.setPerm("sysperm:role:delete");
list.add(a107003);
SysPermApiEntity a108001 = new SysPermApiEntity();
a108001.setId(108001L);
a108001.setOrnum(108001);
a108001.setName("参数查询");
a108001.setMenid(1080L);
a108001.setPerm("sys:config:query");
list.add(a108001);
SysPermApiEntity a108002 = new SysPermApiEntity();
a108002.setId(108002L);
a108002.setOrnum(108002);
a108002.setName("参数编辑");
a108002.setMenid(1080L);
a108002.setPerm("sys:config:edit");
list.add(a108002);
SysPermApiEntity a108003 = new SysPermApiEntity();
a108003.setId(108003L);
a108003.setOrnum(108003);
a108003.setName("参数删除");
a108003.setMenid(1080L);
a108003.setPerm("sys:config:delete");
list.add(a108003);
SysPermApiEntity a109001 = new SysPermApiEntity();
a109001.setId(109001L);
a109001.setOrnum(109001);
a109001.setName("通知查询");
a109001.setMenid(1090L);
a109001.setPerm("sys:notice:query");
list.add(a109001);
SysPermApiEntity a109002 = new SysPermApiEntity();
a109002.setId(109002L);
a109002.setOrnum(109002);
a109002.setName("通知编辑");
a109002.setMenid(1090L);
a109002.setPerm("sys:notice:edit");
list.add(a109002);
SysPermApiEntity a109003 = new SysPermApiEntity();
a109003.setId(109003L);
a109003.setOrnum(109003);
a109003.setName("通知删除");
a109003.setMenid(1090L);
a109003.setPerm("sys:notice:delete");
list.add(a109003);
SysPermApiEntity a201001 = new SysPermApiEntity();
a201001.setId(201001L);
a201001.setOrnum(201001);
a201001.setName("在线用户查询");
a201001.setMenid(2010L);
a201001.setPerm("mon:online:query");
list.add(a201001);
SysPermApiEntity a201002 = new SysPermApiEntity();
a201002.setId(201002L);
a201002.setOrnum(201002);
a201002.setName("在线用户强退");
a201002.setMenid(2010L);
a201002.setPerm("mon:online:delete");
list.add(a201002);
SysPermApiEntity a202001 = new SysPermApiEntity();
a202001.setId(202001L);
a202001.setOrnum(202001);
a202001.setName("登录日志查询");
a202001.setMenid(2020L);
a202001.setPerm("mon:login:query");
list.add(a202001);
SysPermApiEntity a202002 = new SysPermApiEntity();
a202002.setId(202002L);
a202002.setOrnum(202002);
a202002.setName("登录日志删除");
a202002.setMenid(2020L);
a202002.setPerm("mon:login:delete");
list.add(a202002);
SysPermApiEntity a203001 = new SysPermApiEntity();
a203001.setId(203001L);
a203001.setOrnum(203001);
a203001.setName("操作日志查询");
a203001.setMenid(2030L);
a203001.setPerm("mon:oper:query");
list.add(a203001);
SysPermApiEntity a203002 = new SysPermApiEntity();
a203002.setId(203002L);
a203002.setOrnum(203002);
a203002.setName("操作日志删除");
a203002.setMenid(2030L);
a203002.setPerm("mon:oper:delete");
list.add(a203002);
SysPermApiEntity a204001 = new SysPermApiEntity();
a204001.setId(204001L);
a204001.setOrnum(204001);
a204001.setName("服务器信息查询");
a204001.setMenid(2040L);
a204001.setPerm("mon:server:query");
list.add(a204001);
SysPermApiEntity a205001 = new SysPermApiEntity();
a205001.setId(205001L);
a205001.setOrnum(205001);
a205001.setName("缓存信息查询");
a205001.setMenid(2050L);
a205001.setPerm("mon:cache:query");
list.add(a205001);
SysPermApiEntity a206001 = new SysPermApiEntity();
a206001.setId(206001L);
a206001.setOrnum(206001);
a206001.setName("定时任务查询");
a206001.setMenid(2060L);
a206001.setPerm("monjob:main:query");
list.add(a206001);
SysPermApiEntity a206002 = new SysPermApiEntity();
a206002.setId(206002L);
a206002.setOrnum(206002);
a206002.setName("定时任务修改");
a206002.setMenid(2060L);
a206002.setPerm("monjob:main:edit");
list.add(a206002);
SysPermApiEntity a206003 = new SysPermApiEntity();
a206003.setId(206003L);
a206003.setOrnum(206003);
a206003.setName("定时任务执行");
a206003.setMenid(2060L);
a206003.setPerm("monjob:main:run");
list.add(a206003);
SysPermApiEntity a206101 = new SysPermApiEntity();
a206101.setId(206101L);
a206101.setOrnum(206101);
a206101.setName("定时任务日志查询");
a206101.setMenid(2061L);
a206101.setPerm("monjob:log:query");
list.add(a206101);
SysPermApiEntity a206102 = new SysPermApiEntity();
a206102.setId(206102L);
a206102.setOrnum(206102);
a206102.setName("定时任务日志删除");
a206102.setMenid(2061L);
a206102.setPerm("monjob:log:delete");
list.add(a206102);
SysPermApiEntity a301001 = new SysPermApiEntity();
a301001.setId(301001L);
a301001.setOrnum(301001);
a301001.setName("字典查询");
a301001.setMenid(3010L);
a301001.setPerm("tooldict:main:query");
list.add(a301001);
SysPermApiEntity a301002 = new SysPermApiEntity();
a301002.setId(301002L);
a301002.setOrnum(301002);
a301002.setName("字典修改");
a301002.setMenid(3010L);
a301002.setPerm("tooldict:main:edit");
list.add(a301002);
SysPermApiEntity a301003 = new SysPermApiEntity();
a301003.setId(301003L);
a301003.setOrnum(301003);
a301003.setName("字典删除");
a301003.setMenid(3010L);
a301003.setPerm("tooldict:main:delete");
list.add(a301003);
SysPermApiEntity a301004 = new SysPermApiEntity();
a301004.setId(301004L);
a301004.setOrnum(301004);
a301004.setName("字典数据查询");
a301004.setMenid(3010L);
a301004.setPerm("tooldict:data:query");
list.add(a301004);
SysPermApiEntity a301005 = new SysPermApiEntity();
a301005.setId(301005L);
a301005.setOrnum(301005);
a301005.setName("字典数据编辑");
a301005.setMenid(3010L);
a301005.setPerm("tooldict:data:edit");
list.add(a301005);
SysPermApiEntity a301006 = new SysPermApiEntity();
a301006.setId(301006L);
a301006.setOrnum(301006);
a301006.setName("字典数据删除");
a301006.setMenid(3010L);
a301006.setPerm("tooldict:data:delete");
list.add(a301006);
SysPermApiEntity a302001 = new SysPermApiEntity();
a302001.setId(302001L);
a302001.setOrnum(302001);
a302001.setName("编号查询");
a302001.setMenid(3020L);
a302001.setPerm("tool:num:query");
list.add(a302001);
SysPermApiEntity a302002 = new SysPermApiEntity();
a302002.setId(302002L);
a302002.setOrnum(302002);
a302002.setName("编号编辑");
a302002.setMenid(3020L);
a302002.setPerm("tool:num:edit");
list.add(a302002);
SysPermApiEntity a302003 = new SysPermApiEntity();
a302003.setId(302003L);
a302003.setOrnum(302003);
a302003.setName("编号删除");
a302003.setMenid(3020L);
a302003.setPerm("tool:num:delete");
list.add(a302003);
insert(list);
}
public void initWf() {
List<SysPermApiEntity> list = new ArrayList<>();
SysPermApiEntity a603001 = new SysPermApiEntity();
a603001.setId(603001L);
a603001.setOrnum(603001);
a603001.setName("流程查询");
a603001.setMenid(6030L);
a603001.setPerm("wfbus:main:query");
list.add(a603001);
SysPermApiEntity a603002 = new SysPermApiEntity();
a603002.setId(603002L);
a603002.setOrnum(603002);
a603002.setName("流程新增");
a603002.setMenid(6030L);
a603002.setPerm("wfbus:main:add");
list.add(a603002);
SysPermApiEntity a603003 = new SysPermApiEntity();
a603003.setId(603003L);
a603003.setOrnum(603003);
a603003.setName("流程编辑");
a603003.setMenid(6030L);
a603003.setPerm("wfbus:main:edit");
list.add(a603003);
insert(list);
}
private final SysPermApiRepo repo;
private void insert(List<SysPermApiEntity> list) {
for (SysPermApiEntity api : list) {
api.setAvtag(true);
api.setUptim(api.getCrtim());
}
repo.saveAll(list);
}
}
@@ -0,0 +1,10 @@
package vben.setup.sys.perm.api;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysPermApiRepo extends JpaRepository<SysPermApiEntity,String> {
SysPermApiEntity findByPerm(String perm);
}
@@ -0,0 +1,133 @@
package vben.setup.sys.perm.menu;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "sys_perm_menu")
@Schema(description = "权限菜单")
public class SysPermMenuEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 名称
*/
@Column(length = 32)
@Schema(description = "名称")
private String name;
/**
* 父ID
*/
@Schema(description = "父ID")
private Long pid;
/**
* 是否可用
*/
@Schema(description = "可用标记 1启用,0禁用")
private Boolean avtag;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
/**
* 类型
*/
@Column(length = 8)
@Schema(description = "类型")
private String type;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 图标
*/
@Column(length = 64)
@Schema(description = "图标")
private String icon;
/**
* 路由路径
*/
@Column(length = 64)
@Schema(description = "路由路径")
private String path;
/**
* 路由参数
*/
@Column(length = 64)
@Schema(description = "路由参数")
private String param;
/**
* 组件路径
*/
@Column(length = 64)
@Schema(description = "组件路径")
private String comp;
/**
* 显示标记
*/
@Schema(description = "显示标记")
private Boolean shtag;
/**
* 缓存标记
*/
@Schema(description = "缓存标记")
private Boolean catag;
/**
* 外链标记
*/
@Schema(description = "外链标记")
private Boolean outag;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 36)
private String cruid;
/**
* 更新人ID
*/
@Column(length = 36)
private String upuid;
}
@@ -0,0 +1,427 @@
package vben.setup.sys.perm.menu;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysPermMenuInitService {
public void initBase() {
List<SysPermMenuEntity> list=new ArrayList<>();
SysPermMenuEntity m1000 = new SysPermMenuEntity();
m1000.setId(1000L);
m1000.setIcon("tdesign:system-setting");
m1000.setName("系统管理");
m1000.setOrnum(1000);
m1000.setPath("sys");
m1000.setPid(0L);
m1000.setType("1");
m1000.setComp("Layout");
list.add(m1000);
SysPermMenuEntity m1010 = new SysPermMenuEntity();
m1010.setId(1010L);
m1010.setComp("sys/org/dept/index");
m1010.setIcon("mingcute:department-line");
m1010.setName("部门管理");
m1010.setOrnum(1010);
m1010.setPath("org/dept");
m1010.setPid(1000L);
list.add(m1010);
SysPermMenuEntity m1020 = new SysPermMenuEntity();
m1020.setId(1020L);
m1020.setComp("sys/org/user/index");
m1020.setIcon("ant-design:user-outlined");
m1020.setName("用户管理");
m1020.setOrnum(1020);
m1020.setPath("org/user");
m1020.setPid(1000L);
list.add(m1020);
SysPermMenuEntity m1021 = new SysPermMenuEntity();
m1021.setId(1021L);
m1021.setComp("sys/org/user/tedit");
m1021.setIcon("mingcute:user-edit-line");
m1021.setName("用户编辑");
m1021.setOrnum(1021);
m1021.setPath("org/user/edit");
m1021.setCatag(true);
m1021.setShtag(false);
m1021.setPid(1000L);
list.add(m1021);
// SysPermMenuEntity m1022 = new SysPermMenuEntity();
// m1022.setId(1022L);
// m1022.setComp("_core/profile/index");
// m1022.setIcon("iconamoon:profile");
// m1022.setName("个人中心");
// m1022.setOrnum(1022);
// m1022.setPath("profile");
// m1022.setPid(1000L);
// list.add(m1022);
SysPermMenuEntity m1030 = new SysPermMenuEntity();
m1030.setId(1030L);
m1030.setComp("sys/org/post/index");
m1030.setIcon("icon-park-outline:appointment");
m1030.setName("岗位管理");
m1030.setOrnum(1030);
m1030.setPath("org/post");
m1030.setPid(1000L);
list.add(m1030);
SysPermMenuEntity m1040 = new SysPermMenuEntity();
m1040.setId(1040L);
m1040.setComp("sys/org/group/index");
m1040.setIcon("material-symbols:group-outline-rounded");
m1040.setName("群组管理");
m1040.setOrnum(1040);
m1040.setPath("org/group");
m1040.setPid(1000L);
list.add(m1040);
SysPermMenuEntity m1050 = new SysPermMenuEntity();
m1050.setId(1050L);
m1050.setComp("sys/perm/menu/index");
m1050.setIcon("ri:menu-fold-2-fill");
m1050.setName("菜单管理");
m1050.setOrnum(1050);
m1050.setPath("perm/menu");
m1050.setPid(1000L);
list.add(m1050);
SysPermMenuEntity m1060 = new SysPermMenuEntity();
m1060.setId(1060L);
m1060.setComp("sys/perm/api/index");
m1060.setIcon("ant-design:api-outlined");
m1060.setName("接口管理");
m1060.setOrnum(1060);
m1060.setPath("perm/api");
m1060.setPid(1000L);
list.add(m1060);
SysPermMenuEntity m1070 = new SysPermMenuEntity();
m1070.setId(1070L);
m1070.setComp("sys/perm/role/index");
m1070.setIcon("eos-icons:role-binding-outlined");
m1070.setName("角色管理");
m1070.setOrnum(1070);
m1070.setPath("perm/role");
m1070.setPid(1000L);
list.add(m1070);
SysPermMenuEntity m1071 = new SysPermMenuEntity();
m1071.setId(1071L);
m1071.setComp("sys/perm/role/edit");
m1071.setIcon("oui:app-users-roles");
m1071.setName("角色编辑");
m1071.setOrnum(1071);
m1071.setPath("perm/role/edit");
m1071.setCatag(true);
m1071.setShtag(false);
m1071.setPid(1000L);
list.add(m1071);
SysPermMenuEntity m1080 = new SysPermMenuEntity();
m1080.setId(1080L);
m1080.setComp("sys/config/index");
m1080.setIcon("ant-design:setting-outlined");
m1080.setName("参数设置");
m1080.setOrnum(1080);
m1080.setPath("config");
m1080.setPid(1000L);
list.add(m1080);
SysPermMenuEntity m1090 = new SysPermMenuEntity();
m1090.setId(1090L);
m1090.setComp("sys/notice/index");
m1090.setIcon("fe:notice-push");
m1090.setName("通知公告");
m1090.setOrnum(1090);
m1090.setPath("notice");
m1090.setPid(1000L);
list.add(m1090);
SysPermMenuEntity m2000 = new SysPermMenuEntity();
m2000.setId(2000L);
m2000.setIcon("eos-icons:monitoring");
m2000.setName("监控中心");
m2000.setOrnum(2000);
m2000.setPath("mon");
m2000.setPid(0L);
m2000.setType("1");
m2000.setComp("Layout");
list.add(m2000);
SysPermMenuEntity m2010 = new SysPermMenuEntity();
m2010.setId(2010L);
m2010.setComp("mon/online/user/index");
m2010.setIcon("oui:online");
m2010.setName("在线用户");
m2010.setOrnum(2010);
m2010.setPath("online/user");
m2010.setPid(2000L);
list.add(m2010);
SysPermMenuEntity m2020 = new SysPermMenuEntity();
m2020.setId(2020L);
m2020.setComp("mon/login/log/index");
m2020.setIcon("uiw:login");
m2020.setName("登录日志");
m2020.setOrnum(2020);
m2020.setPath("login/log");
m2020.setPid(2000L);
list.add(m2020);
SysPermMenuEntity m2030 = new SysPermMenuEntity();
m2030.setId(2030L);
m2030.setComp("mon/oper/log/index");
m2030.setIcon("icon-park-outline:reverse-operation-in");
m2030.setName("操作日志");
m2030.setOrnum(2030);
m2030.setPath("oper/log");
m2030.setPid(2000L);
list.add(m2030);
SysPermMenuEntity m2040 = new SysPermMenuEntity();
m2040.setId(2040L);
m2040.setComp("mon/server/index");
m2040.setIcon("mdi:server-outline");
m2040.setName("服务监控");
m2040.setOrnum(2040);
m2040.setPath("server");
m2040.setPid(2000L);
list.add(m2040);
SysPermMenuEntity m2050 = new SysPermMenuEntity();
m2050.setId(2050L);
m2050.setComp("mon/cache/index");
m2050.setIcon("octicon:cache-24");
m2050.setName("缓存监控");
m2050.setOrnum(2050);
m2050.setPath("cache");
m2050.setPid(2000L);
list.add(m2050);
SysPermMenuEntity m2060 = new SysPermMenuEntity();
m2060.setId(2060L);
m2060.setComp("mon/job/main/index");
m2060.setIcon("streamline:task-list");
m2060.setName("定时任务");
m2060.setOrnum(2060);
m2060.setPath("job/main");
m2060.setPid(2000L);
list.add(m2060);
SysPermMenuEntity m2061 = new SysPermMenuEntity();
m2061.setId(2061L);
m2061.setComp("mon/job/log/index");
m2061.setIcon("ix:log");
m2061.setName("任务日志");
m2061.setOrnum(2061);
m2061.setPath("job/log");
m2061.setPid(2000L);
m2061.setShtag(false);
list.add(m2061);
SysPermMenuEntity m3000 = new SysPermMenuEntity();
m3000.setId(3000L);
m3000.setIcon("ant-design:tool-outlined");
m3000.setName("辅助工具");
m3000.setOrnum(3000);
m3000.setPath("tool");
m3000.setPid(0L);
m3000.setType("1");
m3000.setComp("Layout");
list.add(m3000);
SysPermMenuEntity m3010 = new SysPermMenuEntity();
m3010.setId(3010L);
m3010.setComp("tool/dict/index");
m3010.setIcon("fluent-mdl2:dictionary");
m3010.setName("字典工具");
m3010.setOrnum(3010);
m3010.setPath("dict");
m3010.setPid(3000L);
list.add(m3010);
SysPermMenuEntity m3020 = new SysPermMenuEntity();
m3020.setId(3020L);
m3020.setComp("tool/num/index");
m3020.setIcon("streamline-sharp:steps-number");
m3020.setName("编号工具");
m3020.setOrnum(3020);
m3020.setPath("num");
m3020.setPid(3000L);
list.add(m3020);
SysPermMenuEntity m3030 = new SysPermMenuEntity();
m3030.setId(3030L);
m3030.setComp("tool/oss/main/index");
m3030.setIcon("mdi:file-outline");
m3030.setName("文件工具");
m3030.setOrnum(3030);
m3030.setPath("oss");
m3030.setPid(3000L);
list.add(m3030);
SysPermMenuEntity m3040 = new SysPermMenuEntity();
m3040.setId(3040L);
m3040.setComp("tool/form/index");
m3040.setIcon("fluent:form-20-regular");
m3040.setName("表单工具");
m3040.setOrnum(3040);
m3040.setPath("form");
m3040.setPid(3000L);
list.add(m3040);
insert(list);
}
public void initWf() {
List<SysPermMenuEntity> list=new ArrayList<>();
SysPermMenuEntity m6000 = new SysPermMenuEntity();
m6000.setId(6000L);
m6000.setIcon("streamline-sharp:text-flow-rows");
m6000.setName("流程管理");
m6000.setOrnum(6000);
m6000.setPath("wf");
m6000.setPid(0L);
m6000.setType("1");
m6000.setComp("Layout");
list.add(m6000);
SysPermMenuEntity m6010 = new SysPermMenuEntity();
m6010.setId(6010L);
m6010.setComp("wf/bus/cate/index");
m6010.setIcon("tabler:category-plus");
m6010.setName("流程分类");
m6010.setOrnum(6010);
m6010.setPath("bus/cate");
m6010.setPid(6000L);
list.add(m6010);
SysPermMenuEntity m6020 = new SysPermMenuEntity();
m6020.setId(6020L);
m6020.setComp("wf/bus/tmpl/index");
m6020.setIcon("carbon:prompt-template");
m6020.setName("流程模板");
m6020.setOrnum(6020);
m6020.setPath("bus/tmpl");
m6020.setPid(6000L);
list.add(m6020);
SysPermMenuEntity m6021 = new SysPermMenuEntity();
m6021.setId(6021L);
m6021.setComp("wf/bus/tmpl/edit");
m6021.setIcon("carbon:prompt-template");
m6021.setName("流程模板编辑");
m6021.setOrnum(6021);
m6021.setPath("bus/tmpl/edit");
m6021.setCatag(true);
m6021.setShtag(false);
m6021.setPid(6000L);
list.add(m6021);
SysPermMenuEntity m6030 = new SysPermMenuEntity();
m6030.setId(6030L);
m6030.setComp("wf/bus/main/index");
m6030.setIcon("ri:instance-line");
m6030.setName("流程清单");
m6030.setOrnum(6030);
m6030.setPath("bus/main");
m6030.setPid(6000L);
list.add(m6030);
SysPermMenuEntity m6031 = new SysPermMenuEntity();
m6031.setId(6031L);
m6031.setComp("wf/bus/main/edit");
m6031.setIcon("ri:instance-line");
m6031.setName("流程编辑");
m6031.setOrnum(6031);
m6031.setPath("bus/main/edit");
m6031.setCatag(true);
m6031.setShtag(false);
m6031.setPid(6000L);
list.add(m6031);
SysPermMenuEntity m6032 = new SysPermMenuEntity();
m6032.setId(6032L);
m6032.setComp("wf/bus/main/view");
m6032.setIcon("ri:instance-line");
m6032.setName("流程查看");
m6032.setOrnum(6032);
m6032.setPath("bus/main/view");
m6032.setCatag(true);
m6032.setShtag(false);
m6032.setPid(6000L);
list.add(m6032);
SysPermMenuEntity m6040 = new SysPermMenuEntity();
m6040.setId(6040L);
m6040.setComp("wf/todo/index");
m6040.setIcon("ri:todo-line");
m6040.setName("流程待办");
m6040.setOrnum(6040);
m6040.setPath("todo");
m6040.setPid(6000L);
list.add(m6040);
SysPermMenuEntity m6050 = new SysPermMenuEntity();
m6050.setId(6050L);
m6050.setComp("wf/org/tree/index");
m6050.setIcon("mdi:workflow-outline");
m6050.setName("流程组织");
m6050.setOrnum(6050);
m6050.setPath("org/tree");
m6050.setPid(6000L);
list.add(m6050);
SysPermMenuEntity m6051 = new SysPermMenuEntity();
m6051.setId(6051L);
m6051.setComp("wf/org/node/index");
m6051.setIcon("mdi:workflow-outline");
m6051.setName("流程组织节点");
m6051.setOrnum(6051);
m6051.setPath("org/node");
m6051.setShtag(false);
m6051.setPid(6000L);
list.add(m6051);
insert(list);
}
private final SysPermMenuRepo repo;
private void insert(List<SysPermMenuEntity> list) {
for (SysPermMenuEntity main : list) {
main.setAvtag(true);
if(main.getCatag()==null){
main.setCatag(false);
}
if(main.getType()==null){
main.setType("2");
}
if(main.getShtag()==null){
main.setShtag(true);
}
if(main.getOutag()==null){
main.setOutag(false);
}
main.setUptim(main.getCrtim());
}
repo.saveAll(list);
}
}
@@ -0,0 +1,12 @@
package vben.setup.sys.perm.menu;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface SysPermMenuRepo extends JpaRepository<SysPermMenuEntity,String> {
List<SysPermMenuEntity> findByNameContaining(String path);
}
@@ -0,0 +1,80 @@
package vben.setup.sys.perm.role;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.perm.api.SysPermApiEntity;
import vben.setup.sys.perm.menu.SysPermMenuEntity;
import java.util.Date;
import java.util.List;
@Data
@Entity
@Table(name = "sys_perm_role")
@Schema(description = "权限角色")
public class SysPermRoleEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 角色名称
*/
@Column(length = 32)
@Schema(description = "角色名称")
private String name;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
@ManyToMany
@JoinTable(name = "sys_perm_role_org", joinColumns = {@JoinColumn(name = "rid")},
inverseJoinColumns = {@JoinColumn(name = "oid")})
@Schema(description = "成员列表")
private List<SysOrg> orgs;
@ManyToMany
@JoinTable(name = "sys_perm_role_menu", joinColumns = {@JoinColumn(name = "rid")},
inverseJoinColumns = {@JoinColumn(name = "mid")})
@Schema(description = "菜单列表")
private List<SysPermMenuEntity> menus;
@ManyToMany
@JoinTable(name = "sys_perm_role_api", joinColumns = {@JoinColumn(name = "rid")},
inverseJoinColumns = {@JoinColumn(name = "aid")})
@Schema(description = "接口列表")
private List<SysPermApiEntity> apis;
}
@@ -0,0 +1,65 @@
package vben.setup.sys.perm.role;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.common.jpa.entity.SysOrg;
import vben.setup.sys.perm.api.SysPermApiEntity;
import vben.setup.sys.perm.api.SysPermApiRepo;
import vben.setup.sys.perm.menu.SysPermMenuRepo;
import java.util.ArrayList;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class SysPermRoleInitService {
public void init() {
List<SysPermRoleEntity> list = new ArrayList<>();
SysPermRoleEntity role = new SysPermRoleEntity();
role.setId(1L);
role.setName("管理员");
role.setNotes("拥有所有权限");
role.setOrnum(1);
role.setOrgs(List.of(new SysOrg("u2"),new SysOrg("u3"),new SysOrg("u4"),new SysOrg("u5")));
role.setMenus(menuRepo.findAll());
role.setApis(apiRepo.findAll());
list.add(role);
SysPermRoleEntity role2 = new SysPermRoleEntity();
role2.setId(2L);
role2.setName("普通用户");
role2.setNotes("只包含流程使用权限");
role2.setOrnum(2);
role2.setOrgs(List.of(new SysOrg("u6"),new SysOrg("u7"),new SysOrg("u8"),new SysOrg("u9")));
role2.setMenus(menuRepo.findByNameContaining("流程"));
List<SysPermApiEntity> apiList = new ArrayList<>();
apiList.add(apiRepo.findByPerm("wfbus:main:query"));
apiList.add(apiRepo.findByPerm("wfbus:main:add"));
apiList.add(apiRepo.findByPerm("wfbus:main:edit"));
// apiList.add(apiRepo.findByPerm("wfbus:main:appv"));
role2.setApis(apiList);
list.add(role2);
insert(list);
}
private final SysPermMenuRepo menuRepo;
private final SysPermApiRepo apiRepo;
private final SysPermRoleRepo roleRepo;
private void insert(List<SysPermRoleEntity> list) {
for (SysPermRoleEntity role : list) {
role.setAvtag(true);
role.setUptim(role.getCrtim());
}
roleRepo.saveAll(list);
}
}
@@ -0,0 +1,8 @@
package vben.setup.sys.perm.role;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SysPermRoleRepo extends JpaRepository<SysPermRoleEntity,String> {
}
@@ -0,0 +1,160 @@
package vben.setup.sys.social;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 社会化关系对象 sys_social
*
* @author thiszhc
*/
@Data
@Entity
@Table(name = "sys_social")
@Schema(description = "三方登录")
public class SysSocialEntity {
/**
* 创建部门
*/
private String createDept;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 主键
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 用户ID
*/
private String userId;
/**
* 的唯一ID
*/
private String authId;
/**
* 用户来源
*/
private String source;
/**
* 用户的授权令牌
*/
private String accessToken;
/**
* 用户的授权令牌的有效期,部分平台可能没有
*/
private int expireIn;
/**
* 刷新令牌,部分平台可能没有
*/
private String refreshToken;
/**
* 用户的 open id
*/
private String openId;
/**
* 授权的第三方账号
*/
private String userName;
/**
* 授权的第三方昵称
*/
private String nickName;
/**
* 授权的第三方邮箱
*/
private String email;
/**
* 授权的第三方头像地址
*/
private String avatar;
/**
* 平台的授权信息,部分平台可能没有
*/
private String accessCode;
/**
* 用户的 unionid
*/
private String unionId;
/**
* 授予的权限,部分平台可能没有
*/
private String scope;
/**
* 个别平台的授权信息,部分平台可能没有
*/
private String tokenType;
/**
* id token,部分平台可能没有
*/
private String idToken;
/**
* 小米平台用户的附带属性,部分平台可能没有
*/
private String macAlgorithm;
/**
* 小米平台用户的附带属性,部分平台可能没有
*/
private String macKey;
/**
* 用户的授权code,部分平台可能没有
*/
private String code;
/**
* Twitter平台用户的附带属性,部分平台可能没有
*/
private String oauthToken;
/**
* Twitter平台用户的附带属性,部分平台可能没有
*/
private String oauthTokenSecret;
}
@@ -0,0 +1,36 @@
package vben.setup.tool.dict;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
@Data
@Entity
@Table(name = "tool_dict_cate")
@Schema(description = "字典分类")
public class ToolDictCateEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 分类名称
*/
@Column(length = 32)
@Schema(description = "名称")
private String name;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
}
@@ -0,0 +1,88 @@
package vben.setup.tool.dict;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "tool_dict_data")
@Schema(description = "字典数据")
public class ToolDictDataEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 数据标签
*/
@Column(length = 64)
@Schema(description = "数据标签")
private String dalab;
/**
* 数据键值
*/
@Column(length = 32)
@Schema(description = "数据键值")
private String daval;
/**
* 字典ID
*/
@Schema(description = "字典ID")
private Long dicid;
/**
* 显示样式
*/
@Column(length = 32)
@Schema(description = "显示样式")
private String shsty;
/**
* 默认标记
*/
@Schema(description = "默认标记")
private Boolean detag;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
}
@@ -0,0 +1,8 @@
package vben.setup.tool.dict;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ToolDictDataRepo extends JpaRepository<ToolDictDataEntity,String> {
}
@@ -0,0 +1,235 @@
package vben.setup.tool.dict;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class ToolDictInitService {
public void init() {
List<ToolDictMainEntity> list1 = new ArrayList<>();
List<ToolDictDataEntity> list2 = new ArrayList<>();
ToolDictMainEntity m1 = new ToolDictMainEntity();
m1.setName("操作类型");
m1.setCode("sys_oper_type");
m1.setId(1L);
m1.setOrnum(1);
list1.add(m1);
ToolDictDataEntity d101 = new ToolDictDataEntity();
d101.setDalab("新增");
d101.setDaval("1");
d101.setId(101L);
d101.setOrnum(1);
d101.setDicid(1L);
d101.setShsty("primary");
list2.add(d101);
ToolDictDataEntity d102 = new ToolDictDataEntity();
d102.setDalab("修改");
d102.setDaval("2");
d102.setId(102L);
d102.setOrnum(2);
d102.setDicid(1L);
d102.setShsty("primary");
list2.add(d102);
ToolDictDataEntity d103 = new ToolDictDataEntity();
d103.setDalab("删除");
d103.setDaval("3");
d103.setId(103L);
d103.setOrnum(3);
d103.setDicid(1L);
d103.setShsty("danger");
list2.add(d103);
ToolDictDataEntity d104 = new ToolDictDataEntity();
d104.setDalab("授权");
d104.setDaval("4");
d104.setId(104L);
d104.setOrnum(4);
d104.setDicid(1L);
d104.setShsty("primary");
list2.add(d104);
ToolDictDataEntity d105 = new ToolDictDataEntity();
d105.setDalab("导出");
d105.setDaval("5");
d105.setId(105L);
d105.setOrnum(5);
d105.setDicid(1L);
d105.setShsty("warning");
list2.add(d105);
ToolDictDataEntity d106 = new ToolDictDataEntity();
d106.setDalab("导入");
d106.setDaval("6");
d106.setId(106L);
d106.setOrnum(6);
d106.setDicid(1L);
d106.setShsty("warning");
list2.add(d106);
ToolDictDataEntity d107 = new ToolDictDataEntity();
d107.setDalab("强退");
d107.setDaval("7");
d107.setId(107L);
d107.setOrnum(7);
d107.setDicid(1L);
d107.setShsty("danger");
list2.add(d107);
ToolDictDataEntity d108 = new ToolDictDataEntity();
d108.setDalab("生成代码");
d108.setDaval("8");
d108.setId(108L);
d108.setOrnum(8);
d108.setDicid(1L);
d108.setShsty("warning");
list2.add(d108);
ToolDictDataEntity d109 = new ToolDictDataEntity();
d109.setDalab("清空数据");
d109.setDaval("9");
d109.setId(109L);
d109.setOrnum(9);
d109.setDicid(1L);
d109.setShsty("danger");
list2.add(d109);
ToolDictDataEntity d199 = new ToolDictDataEntity();
d199.setDalab("其他操作");
d199.setDaval("0");
d199.setId(199L);
d199.setOrnum(99);
d199.setDicid(1L);
d199.setShsty("warning");
list2.add(d199);
ToolDictMainEntity m2 = new ToolDictMainEntity();
m2.setName("授权类型");
m2.setCode("sys_grant_type");
m2.setId(2L);
m2.setOrnum(2);
list1.add(m2);
ToolDictDataEntity d201 = new ToolDictDataEntity();
d201.setDalab("密码认证");
d201.setDaval("password");
d201.setId(201L);
d201.setOrnum(1);
d201.setDicid(2L);
d201.setShsty("default");
list2.add(d201);
ToolDictDataEntity d202 = new ToolDictDataEntity();
d202.setDalab("短信认证");
d202.setDaval("sms");
d202.setId(202L);
d202.setOrnum(2);
d202.setDicid(2L);
d202.setShsty("default");
list2.add(d202);
ToolDictDataEntity d203 = new ToolDictDataEntity();
d203.setDalab("邮箱认证");
d203.setDaval("email");
d203.setId(203L);
d203.setOrnum(3);
d203.setDicid(2L);
d203.setShsty("default");
list2.add(d203);
ToolDictDataEntity d204 = new ToolDictDataEntity();
d204.setDalab("小程序认证");
d204.setDaval("xcx");
d204.setId(204L);
d204.setOrnum(4);
d204.setDicid(2L);
d204.setShsty("default");
list2.add(d204);
ToolDictDataEntity d205 = new ToolDictDataEntity();
d205.setDalab("三方登录认证");
d205.setDaval("social");
d205.setId(205L);
d205.setOrnum(5);
d205.setDicid(2L);
d205.setShsty("default");
list2.add(d205);
ToolDictMainEntity m3 = new ToolDictMainEntity();
m3.setName("设备类型");
m3.setCode("sys_device_type");
m3.setId(3L);
m3.setOrnum(3);
list1.add(m3);
ToolDictDataEntity d301 = new ToolDictDataEntity();
d301.setDalab("PC");
d301.setDaval("PC");
d301.setId(301L);
d301.setOrnum(1);
d301.setDicid(3L);
d301.setShsty("default");
list2.add(d301);
ToolDictDataEntity d302 = new ToolDictDataEntity();
d302.setDalab("安卓");
d302.setDaval("android");
d302.setId(302L);
d302.setOrnum(2);
d302.setDicid(3L);
d302.setShsty("default");
list2.add(d302);
ToolDictDataEntity d303 = new ToolDictDataEntity();
d303.setDalab("苹果");
d303.setDaval("IOS");
d303.setId(303L);
d303.setOrnum(3);
d303.setDicid(3L);
d303.setShsty("default");
list2.add(d303);
ToolDictDataEntity d304 = new ToolDictDataEntity();
d304.setDalab("小程序");
d304.setDaval("XCX");
d304.setId(304L);
d304.setOrnum(4);
d304.setDicid(3L);
d304.setShsty("default");
list2.add(d304);
insert(list1,list2);
}
private final ToolDictDataRepo dataRepo;
private final ToolDictMainRepo mainRepo;
private void insert(List<ToolDictMainEntity> list1,List<ToolDictDataEntity> list2) {
for (ToolDictDataEntity data : list2) {
data.setCrtim(new Date());
data.setUptim(data.getCrtim());
data.setAvtag(true);
}
mainRepo.saveAll(list1);
dataRepo.saveAll(list2);
}
}
@@ -0,0 +1,76 @@
package vben.setup.tool.dict;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "tool_dict_main")
@Schema(description = "字典信息")
public class ToolDictMainEntity {
/**
* 主键ID
*/
@Id
@Schema(description = "主键ID")
private Long id;
/**
* 字典名称
*/
@Column(length = 64)
@Schema(description = "名称")
private String name;
/**
* 字典代码
*/
@Column(length = 64)
@Schema(description = "字典代码")
private String code;
/**
* 分类ID
*/
@Schema(description = "分类ID")
private Long catid;
/**
* 备注
*/
@Schema(description = "名称")
private String notes;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 排序号
*/
@Schema(description = "排序号")
private Integer ornum;
}
@@ -0,0 +1,8 @@
package vben.setup.tool.dict;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ToolDictMainRepo extends JpaRepository<ToolDictMainEntity,String> {
}
@@ -0,0 +1,67 @@
package vben.setup.tool.num;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Entity
@Data
@Table(name = "tool_num")
@Schema(description = "编号信息")
public class ToolNumEntity {
@Id
@Column(length = 8)
@Schema(description = "主键ID")
private String id;
@Column(length = 100)
@Schema(description = "标签")
private String label;
@Column(length = 32)
@Schema(description = "名称")
private String name;
@Column(length = 32)
@Schema(description = "生成模式")
private String numod;
@Column(length = 32)
@Schema(description = "编号前缀")
private String nupre;
@Schema(description = "是否被修改过或新添加的")
private Boolean nflag;
@Column(length = 8)
@Schema(description = "下一个编号")
private String nunex;
@Schema(description = "编号长度")
private Integer nulen;
@Schema(description = "当前日期")
@Column(length = 8)
private String cudat;
@Schema(description = "创建时间")
@Column(updatable = false)
private Date crtim = new Date();
@Schema(description = "更新时间")
private Date uptim;
@Schema(description = "可用标记")
private Boolean avtag;
@Schema(description = "排序号")
private Integer ornum;
@Schema(description = "备注")
private String notes;
}
@@ -0,0 +1,36 @@
package vben.setup.tool.num;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/**
* 部门初始化
*/
@Service
@RequiredArgsConstructor
@Transactional
public class ToolNumInitService {
public void init() {
ToolNumEntity num = new ToolNumEntity();
num.setId("BUS");
num.setName("流程滨蒿");
num.setNflag(true);
num.setNulen(4);
num.setNumod("YYYYMMDD");
num.setNupre("BUS");
num.setOrnum(1);
insert(num);
}
private final ToolNumRepo numRepo;
private void insert(ToolNumEntity num) {
num.setAvtag(true);
num.setUptim(num.getCrtim());
numRepo.save(num);
}
}
@@ -0,0 +1,8 @@
package vben.setup.tool.num;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ToolNumRepo extends JpaRepository<ToolNumEntity,String> {
}
@@ -0,0 +1,125 @@
package vben.setup.tool.oss;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* 对象存储配置对象 sys_oss_config
*
* @author Lion Li
*/
@Data
@Entity
@Table(name = "sys_oss_config")
public class SysOssConfigEntity {
/**
* 搜索值
*/
@JsonIgnore
private String searchValue;
/**
* 创建部门
*/
private Long createDept;
/**
* 创建者
*/
private Long createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新者
*/
private Long updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 请求参数
*/
// private Map<String, Object> params = new HashMap<>();
@Id
private Long ossConfigId;
/**
* 配置key
*/
private String configKey;
/**
* accessKey
*/
private String accessKey;
/**
* 秘钥
*/
private String secretKey;
/**
* 桶名称
*/
private String bucketName;
/**
* 前缀
*/
private String prefix;
/**
* 访问站点
*/
private String endpoint;
/**
* 自定义域名
*/
private String domain;
/**
* 是否https(0否 1是)
*/
private String isHttps;
/**
* 域
*/
private String region;
/**
* 是否默认(0=是,1=否)
*/
private String status;
/**
* 扩展字段
*/
private String ext1;
/**
* 备注
*/
private String remark;
/**
* 桶权限类型(0private 1public 2custom)
*/
private String accessPolicy;
}
@@ -0,0 +1,94 @@
package vben.setup.tool.oss;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
/**
* OSS对象存储对象
*
* @author Lion Li
*/
@Data
@Entity
@Table(name = "sys_oss")
public class SysOssEntity {
/**
* 搜索值
*/
@JsonIgnore
private String searchValue;
/**
* 创建部门
*/
private Long createDept;
/**
* 创建者
*/
private Long createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新者
*/
private Long updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 请求参数
*/
// private Map<String, Object> params = new HashMap<>();
private String tenantId;
/**
* 对象存储主键
*/
@Id
private Long ossId;
/**
* 文件名
*/
private String fileName;
/**
* 原名
*/
private String originalName;
/**
* 文件后缀名
*/
private String fileSuffix;
/**
* URL地址
*/
private String url;
/**
* 扩展字段
*/
private String ext1;
/**
* 服务商
*/
private String service;
}
@@ -0,0 +1,38 @@
package vben.setup.tool.oss;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;
@Entity
@Data
@Schema(description = "OSS存储文件")
@Table(name = "tool_oss_file",indexes = {@Index(columnList = "md5")})
public class ToolOssFileEntity {
@Id
@Column(length = 32)
@Schema(description = "主键ID")
private String id;
@Column(length = 32)
@Schema(description = "文件md5")
private String md5;
@Schema(description = "文件大小")
private Long fsize;
@Schema(description = "存储地址")
private String path;
@Column(length = 32)
@Schema(description = "服务商")
private String service;
@Column(updatable = false)
@Schema(description = "创建时间")
private Date crtim = new Date();
}
@@ -0,0 +1,45 @@
package vben.setup.tool.oss;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import vben.common.jpa.entity.SysOrg;
import java.util.Date;
@Entity
@Data
@Schema(description = "OSS存储引用")
@Table(name = "tool_oss_main")
public class ToolOssMainEntity {
@Id
@Column(length = 32)
@Schema(description = "主键ID")
private String id;
@Schema(description = "文件名称")
private String name;
@Column(length = 32)
@Schema(description = "类型(后缀)")
private String type;
@Column(length = 32)
@Schema(description = "文件ID")
private String filid;
@Column(length = 32)
@Schema(description = "业务ID")
private String busid;
@Column(updatable = false)
@Schema(description = "创建时间")
private Date crtim = new Date();
@ManyToOne
@JoinColumn(name = "cruid", updatable = false)
@Schema(description = "创建人")
protected SysOrg crman;
}
@@ -0,0 +1,69 @@
package vben.setup.wf.bus;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "wf_bus_cate")
public class WfBusCateEntity {
/**
* 主键ID
*/
@Id
private Long id;
/**
* 名称
*/
@Column(length = 64)
private String name;
/**
* 父ID
*/
private Long pid;
/**
* 是否可用
*/
private Boolean avtag;
/**
* 排序号
*/
private Integer ornum;
/**
* 创建时间
*/
private Date crtim = new Date();
/**
* 更新时间
*/
private Date uptim;
/**
* 创建人ID
*/
@Column(length = 36)
private String cruid;
/**
* 更新人ID
*/
@Column(length = 36)
private String upuid;
private String notes;
}
@@ -0,0 +1,8 @@
package vben.setup.wf.bus;
import org.springframework.data.jpa.repository.JpaRepository;
public interface WfBusCateRepo extends JpaRepository<WfBusCateEntity,String> {
}
@@ -0,0 +1,347 @@
package vben.setup.wf.bus;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vben.setup.wf.proc.WfProcDefEntity;
import vben.setup.wf.proc.WfProcDefRepo;
@Service
@RequiredArgsConstructor
@Transactional
public class WfBusInitService {
public void init() {
WfBusCateEntity cate = new WfBusCateEntity();
cate.setId(1L);
cate.setName("人事管理");
cate.setAvtag(true);
cate.setOrnum(1);
cate.setUptim(cate.getCrtim());
cateRepo.save(cate);
WfBusCateEntity cate2 = new WfBusCateEntity();
cate2.setId(2L);
cate2.setName("财务管理");
cate2.setAvtag(true);
cate2.setOrnum(2);
cate2.setUptim(cate.getCrtim());
cateRepo.save(cate2);
WfBusTmplEntity tmpl = new WfBusTmplEntity();
tmpl.setId(101L);
tmpl.setName("请假申请");
tmpl.setAvtag(true);
tmpl.setUptim(tmpl.getCrtim());
tmpl.setCatid(1L);
tmpl.setFpath("wf/bus/leave/edit.vue");
tmpl.setFtype(1);
tmpl.setPrdid(101L);
tmpl.setCruid("1");
tmplRepo.save(tmpl);
WfProcDefEntity def=new WfProcDefEntity();
def.setId(101L);
def.setName("请假申请");
def.setUptim(def.getCrtim());
def.setBusid(101L);
def.setDixml("""
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:activiti="http://activiti.org/bpmn" id="sample-diagram" targetNamespace="http://activiti.org/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="Process_1" name="1" isExecutable="true">
<bpmn2:startEvent id="NS" name="开始节点">
<bpmn2:outgoing>L1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="L1" sourceRef="NS" targetRef="N1" />
<bpmn2:endEvent id="NE" name="结束节点">
<bpmn2:incoming>Flow_1y4gj3o</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:userTask id="N1" name="起草节点" activiti:assignee="l4" activiti:candidateUsers="">
<bpmn2:documentation>起草节点,表单数据一般从绑定的表单提取</bpmn2:documentation>
<bpmn2:extensionElements>
<activiti:formProperty id="userid" type="string" />
<activiti:formProperty id="money" type="int" />
<activiti:properties>
<activiti:property name="编辑" value="edit" />
<activiti:property name="撤回" value="back" />
<activiti:property name="提交" value="commit" />
</activiti:properties>
</bpmn2:extensionElements>
<bpmn2:incoming>L1</bpmn2:incoming>
<bpmn2:outgoing>L2</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="L2" sourceRef="N1" targetRef="N2" />
<bpmn2:userTask id="N2" name="张三" custom="2" hamen="u3" flway="1" hatyp="1">
<bpmn2:incoming>L2</bpmn2:incoming>
<bpmn2:outgoing>Flow_1bq3j11</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_1bq3j11" sourceRef="N2" targetRef="N3" />
<bpmn2:userTask id="N3" name="李四" custom="2" hamen="u4" flway="1" hatyp="1">
<bpmn2:incoming>Flow_1bq3j11</bpmn2:incoming>
<bpmn2:outgoing>Flow_18t60da</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_18t60da" sourceRef="N3" targetRef="N4" />
<bpmn2:userTask id="N4" name="王五" custom="2" hamen="u5" flway="1" hatyp="1">
<bpmn2:incoming>Flow_18t60da</bpmn2:incoming>
<bpmn2:outgoing>Flow_1y4gj3o</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_1y4gj3o" sourceRef="N4" targetRef="NE" />
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNEdge id="Flow_0rj5mf6_di" bpmnElement="L2">
<di:waypoint x="360" y="240" />
<di:waypoint x="360" y="300" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1u6pmzo_di" bpmnElement="L1">
<di:waypoint x="360" y="78" />
<di:waypoint x="360" y="160" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bq3j11_di" bpmnElement="Flow_1bq3j11">
<di:waypoint x="360" y="380" />
<di:waypoint x="360" y="440" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_18t60da_di" bpmnElement="Flow_18t60da">
<di:waypoint x="360" y="520" />
<di:waypoint x="360" y="560" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1y4gj3o_di" bpmnElement="Flow_1y4gj3o">
<di:waypoint x="360" y="640" />
<di:waypoint x="360" y="722" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_0byql27_di" bpmnElement="NS">
<dc:Bounds x="342" y="42" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="339" y="12" width="43" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0g48n8q_di" bpmnElement="N1">
<dc:Bounds x="310" y="160" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N2_di" bpmnElement="N2">
<dc:Bounds x="310" y="300" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N3_di" bpmnElement="N3">
<dc:Bounds x="310" y="440" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1h4oob7_di" bpmnElement="NE">
<dc:Bounds x="342" y="722" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="339" y="765" width="44" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N4_di" bpmnElement="N4">
<dc:Bounds x="310" y="560" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
""");
def.setExxml("""
<?xml version="1.0" encoding="gb2312"?>
<process id="Process_1" name="1" isExecutable="true">
<startEvent id="NS" name="开始节点">
<outgoing>L1</outgoing>
</startEvent>
<sequenceFlow id="L1" sourceRef="NS" targetRef="N1" />
<endEvent id="NE" name="结束节点">
<incoming>Flow_1y4gj3o</incoming>
</endEvent>
<userTask id="N1" name="起草节点" assignee="l4" candidateUsers="">
<documentation>起草节点,表单数据一般从绑定的表单提取</documentation>
<extensionElements>
<formProperty id="userid" type="string" />
<formProperty id="money" type="int" />
<properties>
<property name="编辑" value="edit" />
<property name="撤回" value="back" />
<property name="提交" value="commit" />
</properties>
</extensionElements>
<incoming>L1</incoming>
<outgoing>L2</outgoing>
</userTask>
<sequenceFlow id="L2" sourceRef="N1" targetRef="N2" />
<userTask id="N2" name="张三" custom="2" hamen="u3" flway="1" hatyp="1">
<incoming>L2</incoming>
<outgoing>Flow_1bq3j11</outgoing>
</userTask>
<sequenceFlow id="Flow_1bq3j11" sourceRef="N2" targetRef="N3" />
<userTask id="N3" name="李四" custom="2" hamen="u4" flway="1" hatyp="1">
<incoming>Flow_1bq3j11</incoming>
<outgoing>Flow_18t60da</outgoing>
</userTask>
<sequenceFlow id="Flow_18t60da" sourceRef="N3" targetRef="N4" />
<userTask id="N4" name="王五" custom="2" hamen="u5" flway="1" hatyp="1">
<incoming>Flow_18t60da</incoming>
<outgoing>Flow_1y4gj3o</outgoing>
</userTask>
<sequenceFlow id="Flow_1y4gj3o" sourceRef="N4" targetRef="NE" />
</process>
""");
defRepo.save(def);
WfBusTmplEntity tmpl2 = new WfBusTmplEntity();
tmpl2.setId(102L);
tmpl2.setName("费用报销");
tmpl2.setAvtag(true);
tmpl2.setUptim(tmpl.getCrtim());
tmpl2.setCatid(2L);
tmpl2.setFtype(2);
tmpl2.setPrdid(102L);
tmpl2.setCruid("1");
tmpl2.setFrule("""
[{"type":"input","field":"Frtvmgptja5aabc","title":"输入框","info":"","$required":false,"_fc_id":"id_F7hhmgptja5aacc","name":"ref_Fjk7mgptja5aadc","display":true,"hidden":false,"_fc_drag_tag":"input"},{"type":"inputNumber","field":"Fgo2mgptjbi6aec","title":"计数器","info":"","$required":false,"_fc_id":"id_Fa9kmgptjbi6afc","name":"ref_Flp4mgptjbi6agc","display":true,"hidden":false,"_fc_drag_tag":"inputNumber"},{"type":"rate","field":"F5tgmgptjck1ahc","title":"评分","info":"","$required":false,"_fc_id":"id_F9xrmgptjck1aic","name":"ref_Faimmgptjck1ajc","display":true,"hidden":false,"_fc_drag_tag":"rate","value":0},{"type":"colorPicker","field":"Foh5mgptjf6sakc","title":"颜色选择器","info":"","$required":false,"_fc_id":"id_Fyctmgptjf6salc","name":"ref_Fz0wmgptjf6samc","display":true,"hidden":false,"_fc_drag_tag":"colorPicker"}]
""");
tmplRepo.save(tmpl2);
WfProcDefEntity def2=new WfProcDefEntity();
def2.setId(102L);
def2.setName("费用报销");
def2.setUptim(def.getCrtim());
def2.setBusid(102L);
def2.setDixml("""
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:activiti="http://activiti.org/bpmn" id="sample-diagram" targetNamespace="http://activiti.org/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="Process_1" name="1" isExecutable="true">
<bpmn2:startEvent id="NS" name="开始节点">
<bpmn2:outgoing>L1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="L1" sourceRef="NS" targetRef="N1" />
<bpmn2:endEvent id="NE" name="结束节点">
<bpmn2:incoming>Flow_1w4wv04</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:userTask id="N1" name="起草节点" activiti:assignee="l4" activiti:candidateUsers="">
<bpmn2:documentation>起草节点,表单数据一般从绑定的表单提取</bpmn2:documentation>
<bpmn2:extensionElements>
<activiti:formProperty id="userid" type="string" />
<activiti:formProperty id="money" type="int" />
<activiti:properties>
<activiti:property name="编辑" value="edit" />
<activiti:property name="撤回" value="back" />
<activiti:property name="提交" value="commit" />
</activiti:properties>
</bpmn2:extensionElements>
<bpmn2:incoming>L1</bpmn2:incoming>
<bpmn2:outgoing>L2</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="L2" sourceRef="N1" targetRef="N2" />
<bpmn2:userTask id="N2" name="张三" custom="2" hamen="u3" flway="1" hatyp="1">
<bpmn2:incoming>L2</bpmn2:incoming>
<bpmn2:outgoing>Flow_0opcpii</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_0opcpii" sourceRef="N2" targetRef="N3" />
<bpmn2:userTask id="N3" name="李四" custom="2" hamen="u4" flway="1" hatyp="1">
<bpmn2:incoming>Flow_0opcpii</bpmn2:incoming>
<bpmn2:outgoing>Flow_15dokow</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_15dokow" sourceRef="N3" targetRef="N4" />
<bpmn2:userTask id="N4" name="王五" custom="2" hamen="u5" flway="1" hatyp="1">
<bpmn2:incoming>Flow_15dokow</bpmn2:incoming>
<bpmn2:outgoing>Flow_1w4wv04</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="Flow_1w4wv04" sourceRef="N4" targetRef="NE" />
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNEdge id="Flow_1w4wv04_di" bpmnElement="Flow_1w4wv04">
<di:waypoint x="870" y="180" />
<di:waypoint x="922" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_15dokow_di" bpmnElement="Flow_15dokow">
<di:waypoint x="710" y="180" />
<di:waypoint x="770" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0opcpii_di" bpmnElement="Flow_0opcpii">
<di:waypoint x="560" y="180" />
<di:waypoint x="610" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0rj5mf6_di" bpmnElement="L2">
<di:waypoint x="400" y="180" />
<di:waypoint x="460" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1u6pmzo_di" bpmnElement="L1">
<di:waypoint x="228" y="180" />
<di:waypoint x="300" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_0byql27_di" bpmnElement="NS">
<dc:Bounds x="192" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="189" y="132" width="44" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1h4oob7_di" bpmnElement="NE">
<dc:Bounds x="922" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="919" y="205" width="44" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0g48n8q_di" bpmnElement="N1">
<dc:Bounds x="300" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N2_di" bpmnElement="N2">
<dc:Bounds x="460" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N3_di" bpmnElement="N3">
<dc:Bounds x="610" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="N4_di" bpmnElement="N4">
<dc:Bounds x="770" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
""");
def2.setExxml("""
<?xml version="1.0" encoding="gb2312"?>
<process id="Process_1" name="1" isExecutable="true">
<startEvent id="NS" name="开始节点">
<outgoing>L1</outgoing>
</startEvent>
<sequenceFlow id="L1" sourceRef="NS" targetRef="N1" />
<endEvent id="NE" name="结束节点">
<incoming>Flow_1w4wv04</incoming>
</endEvent>
<userTask id="N1" name="起草节点" assignee="l4" candidateUsers="">
<documentation>起草节点,表单数据一般从绑定的表单提取</documentation>
<extensionElements>
<formProperty id="userid" type="string" />
<formProperty id="money" type="int" />
<properties>
<property name="编辑" value="edit" />
<property name="撤回" value="back" />
<property name="提交" value="commit" />
</properties>
</extensionElements>
<incoming>L1</incoming>
<outgoing>L2</outgoing>
</userTask>
<sequenceFlow id="L2" sourceRef="N1" targetRef="N2" />
<userTask id="N2" name="张三" custom="2" hamen="u3" flway="1" hatyp="1">
<incoming>L2</incoming>
<outgoing>Flow_0opcpii</outgoing>
</userTask>
<sequenceFlow id="Flow_0opcpii" sourceRef="N2" targetRef="N3" />
<userTask id="N3" name="李四" custom="2" hamen="u4" flway="1" hatyp="1">
<incoming>Flow_0opcpii</incoming>
<outgoing>Flow_15dokow</outgoing>
</userTask>
<sequenceFlow id="Flow_15dokow" sourceRef="N3" targetRef="N4" />
<userTask id="N4" name="王五" custom="2" hamen="u5" flway="1" hatyp="1">
<incoming>Flow_15dokow</incoming>
<outgoing>Flow_1w4wv04</outgoing>
</userTask>
<sequenceFlow id="Flow_1w4wv04" sourceRef="N4" targetRef="NE" />
</process>
""");
defRepo.save(def2);
}
private final WfBusCateRepo cateRepo;
private final WfBusTmplRepo tmplRepo;
private final WfProcDefRepo defRepo;
}
@@ -0,0 +1,105 @@
package vben.setup.wf.bus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;
@Entity
@Data
@Table(name = "wf_bus_leave")
public class WfBusLeaveEntity {
//<<<----------------------BaseMainEntity字段开始-----------------------
/**
* 主键ID
*/
@Id
private Long id;
/**
* 名称|主题
*/
@Column(length = 128)
@Schema(description = "名称|主题")
private String name;
/**
* 可用标记
*/
@Schema(description = "可用标记")
private Boolean avtag;
/**
* 创建人ID
*/
@Column(length = 36)
@Schema(description = "创建人ID")
private String cruid;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date crtim = new Date();
/**
* 更新人ID
*/
@Column(length = 36)
@Schema(description = "更新人ID")
private String upuid;
/**
* 更新时间
*/
@Schema(description = "更新时间")
private Date uptim;
/**
* 备注
*/
@Schema(description = "备注")
private String notes;
//>>>----------------------BaseMainEntity字段结束-----------------------
/**
* 请假类型
*/
@Column(length = 8)
@Schema(description = "请假类型")
private String type;
/**
* 开始时间
*/
@Schema(description = "开始时间")
private Date sttim;
/**
* 结束时间
*/
@Schema(description = "结束时间")
private Date entim;
/**
* 请假天数
*/
@Schema(description = "请假天数")
private Integer days;
/**
* 请假原因
*/
@Schema(description = "请假原因")
private String reason;
/**
* 状态
*/
@Schema(description = "状态")
private String state;
}
@@ -0,0 +1,67 @@
package vben.setup.wf.bus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "wf_bus_main")
public class WfBusMainEntity {
@Id
@Column(length = 32)
@Schema(description = "主键ID")
private Long id;
private String name;
private Boolean avtag = true;
@Column(length = 36)
private String cruid;
private Date crtim = new Date();
@Column(length = 36)
private String upuid;
private Date uptim;
private String notes;
/**
* 流程模板ID
*/
private Long tmpid;
/**
* 流程状态
*/
@Column(length = 8)
private String state;
/**
* 流程定义ID
*/
private Long prdid;
/**
* 表单定义ID
*/
private Long fodid;
/**
* 表单数据
*/
@Column(length = 4000)
private String fdata;
}
@@ -0,0 +1,67 @@
package vben.setup.wf.bus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;
@Data
@Entity
@Table(name = "wf_bus_tmpl")
public class WfBusTmplEntity {
@Id
@Schema(description = "主键ID")
private Long id;
@Column(length = 126)
@Schema(description = "名称")
private String name;
@Schema(description = "可用标记")
private Boolean avtag = true;// 1启用,0禁用
@Column(length = 36)
private String cruid;
@Column(updatable = false)
@Schema(description = "创建时间")
private Date crtim = new Date();
@Column(length = 36)
private String upuid;
@Schema(description = "更新时间")
private Date uptim;
@Schema(description = "备注")
private String notes;
@Schema(description = "排序号")
private Integer ornum;
@Column(length = 32)
@Schema(description = "分类ID")
private Long catid;
@Transient
private String wfXml;
@Schema(description = "流程定义ID")
private Long prdid;
@Schema(description = "表单定义ID")
private Long fodid;
@Schema(description = "表单路径")
private String fpath;
@Schema(description = "表单类型")
private Integer ftype;
// @Transient
@Column(length = 4000)
private String frule;
}
@@ -0,0 +1,8 @@
package vben.setup.wf.bus;
import org.springframework.data.jpa.repository.JpaRepository;
public interface WfBusTmplRepo extends JpaRepository<WfBusTmplEntity,String> {
}
@@ -0,0 +1,4 @@
package vben.setup.wf.org;
public class WfOrgInitService {
}

Some files were not shown because too many files have changed in this diff Show More