commit
7beaab737c
1550 changed files with 854365 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||||
|
# http://editorconfig.org |
||||
|
root = true |
||||
|
|
||||
|
# 空格替代Tab缩进在各种编辑工具下效果一致 |
||||
|
[*] |
||||
|
indent_style = space |
||||
|
indent_size = 4 |
||||
|
charset = utf-8 |
||||
|
end_of_line = lf |
||||
|
trim_trailing_whitespace = true |
||||
|
insert_final_newline = true |
||||
|
|
||||
|
[*.{json,yml,yaml}] |
||||
|
indent_size = 2 |
||||
|
|
||||
|
[*.md] |
||||
|
insert_final_newline = false |
||||
|
trim_trailing_whitespace = false |
@ -0,0 +1,47 @@ |
|||||
|
###################################################################### |
||||
|
# Build Tools |
||||
|
|
||||
|
.gradle |
||||
|
/build/ |
||||
|
!gradle/wrapper/gradle-wrapper.jar |
||||
|
|
||||
|
target/ |
||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||
|
|
||||
|
###################################################################### |
||||
|
# IDE |
||||
|
|
||||
|
### STS ### |
||||
|
.apt_generated |
||||
|
.classpath |
||||
|
.factorypath |
||||
|
.project |
||||
|
.settings |
||||
|
.springBeans |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### JRebel ### |
||||
|
rebel.xml |
||||
|
### NetBeans ### |
||||
|
nbproject/private/ |
||||
|
build/* |
||||
|
nbbuild/ |
||||
|
nbdist/ |
||||
|
.nb-gradle/ |
||||
|
|
||||
|
###################################################################### |
||||
|
# Others |
||||
|
*.log |
||||
|
*.xml.versionsBackup |
||||
|
*.swp |
||||
|
|
||||
|
!*/build/*.java |
||||
|
!*/build/*.html |
||||
|
!*/build/*.xml |
||||
|
|
||||
|
.flattened-pom.xml |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-auth" type="docker-deploy" factoryName="dockerfile"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-auth:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-auth/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-gateway" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-gateway:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-gateway/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-gen" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-gen:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-gen/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-job" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-job:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-job/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-monitor" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-monitor:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-monitor/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-nacos" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-nacos:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-nacos/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-resource" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-resource:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-resource/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-seata-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-seata-server:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-seata-server/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-sentinel-dashboard" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-sentinel-dashboard:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-sentinel-dashboard/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-snailjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-snailjob-server/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-system" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-system:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-system/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,12 @@ |
|||||
|
<component name="ProjectRunConfigurationManager"> |
||||
|
<configuration default="false" name="ruoyi-workflow" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
||||
|
<deployment type="dockerfile"> |
||||
|
<settings> |
||||
|
<option name="imageTag" value="ruoyi/ruoyi-workflow:2.2.2" /> |
||||
|
<option name="buildOnly" value="true" /> |
||||
|
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-workflow/Dockerfile" /> |
||||
|
</settings> |
||||
|
</deployment> |
||||
|
<method v="2" /> |
||||
|
</configuration> |
||||
|
</component> |
@ -0,0 +1,21 @@ |
|||||
|
MIT License |
||||
|
|
||||
|
Copyright (c) 2022 RuoYi-Cloud-Plus |
||||
|
|
||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
of this software and associated documentation files (the "Software"), to deal |
||||
|
in the Software without restriction, including without limitation the rights |
||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
copies of the Software, and to permit persons to whom the Software is |
||||
|
furnished to do so, subject to the following conditions: |
||||
|
|
||||
|
The above copyright notice and this permission notice shall be included in all |
||||
|
copies or substantial portions of the Software. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
|
SOFTWARE. |
@ -0,0 +1,182 @@ |
|||||
|
<img src="https://foruda.gitee.com/images/1679673780944866919/d908a86f_1766278.png" width="56%" height="56%"> |
||||
|
<div style="height: 10px; clear: both;"></div> |
||||
|
|
||||
|
- - - |
||||
|
## 平台简介 |
||||
|
|
||||
|
[](https://gitee.com/dromara/RuoYi-Cloud-Plus) |
||||
|
[](https://github.com/dromara/RuoYi-Cloud-Plus) |
||||
|
[](https://gitee.com/dromara/RuoYi-Cloud-Plus/blob/master/LICENSE) |
||||
|
[](https://www.jetbrains.com/?from=RuoYi-Cloud-Plus) |
||||
|
<br> |
||||
|
[](https://gitee.com/dromara/RuoYi-Cloud-Plus) |
||||
|
[]() |
||||
|
[]() |
||||
|
[]() |
||||
|
|
||||
|
> RuoYi-Cloud-Plus `微服务通用权限管理系统` 重写 RuoYi-Cloud 全方位升级(不兼容原框架) |
||||
|
|
||||
|
> 项目代码、文档 均开源免费可商用 遵循开源协议在项目中保留开源协议文件即可<br> |
||||
|
活到老写到老 为兴趣而开源 为学习而开源 为让大家真正可以学到技术而开源 |
||||
|
|
||||
|
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system) |
||||
|
|
||||
|
> 前端项目地址: [plus-ui](https://gitee.com/JavaLionLi/plus-ui) |
||||
|
|
||||
|
> 文档地址: [plus-doc](https://plus-doc.dromara.org) |
||||
|
|
||||
|
## 赞助商 |
||||
|
|
||||
|
MaxKey 业界领先单点登录产品 - https://gitee.com/dromara/MaxKey <br> |
||||
|
CCFlow 驰聘低代码-流程-表单 - https://gitee.com/opencc/RuoYi-JFlow <br> |
||||
|
数舵科技 软件定制开发APP小程序等 - http://www.shuduokeji.com/ <br> |
||||
|
引迈信息 软件开发平台 - https://www.jnpfsoft.com/index.html?from=plus-doc <br> |
||||
|
[如何成为赞助商 加群联系作者详谈](https://plus-doc.dromara.org/#/common/add_group) |
||||
|
|
||||
|
# 本框架与RuoYi的功能差异 |
||||
|
|
||||
|
| 功能 | 本框架 | RuoYi | |
||||
|
|-------------|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| |
||||
|
| 前端项目 | 采用 Vue3 + TS + ElementPlus 重写 | 基于Vue2/Vue3 + JS | |
||||
|
| 后端项目结构 | 采用插件化 + 扩展包形式 结构解耦 易于扩展 | 模块相互注入耦合严重难以扩展 | |
||||
|
| 后端代码风格 | 严格遵守Alibaba规范与项目统一配置的代码格式化 | 代码书写与常规结构不同阅读障碍大 | |
||||
|
| 分布式注册中心 | 采用 Alibaba Nacos 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Nacos 自行搭建纯官方版本不可靠 | |
||||
|
| 分布式配置中心 | 采用 Alibaba Nacos 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Nacos 自行搭建纯官方版本不可靠 | |
||||
|
| 服务网关 | 采用 SpringCloud Gateway 框架扩展了多种功能<br/>例如:内网鉴权、请求体缓存、跨域配置、请求响应日志等 | 采用 SpringCloud Gateway 功能单一 | |
||||
|
| 负载均衡 | 采用 SpringCloud Loadbalancer 扩展支持了开发团队路由 便于多团队开发调试 | 采用 SpringCloud Loadbalancer 功能单一 | |
||||
|
| RPC远程调用 | 采用 全新 Apache Dubbo 3.X 历史悠远不用多说 | 采用 feign 功能有限编写方式 网络波动大 不稳定 | |
||||
|
| 分布式限流熔断 | 采用 Alibaba Sentinel 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Sentinel 自行搭建纯官方版本不可靠 | |
||||
|
| 分布式事务 | 采用 Alibaba Seata 源码集成对接了Nacos与各种监控 简化了搭建部署流程 | 采用 Alibaba Seata 自行搭建纯官方版本 搭建繁琐与Nacos不挂钩 代码内使用方式怪异等 | |
||||
|
| Web容器 | 采用 Undertow 基于 XNIO 的高性能容器 | 采用 Tomcat | |
||||
|
| 权限认证 | 采用 Sa-Token、Jwt 静态使用功能齐全 低耦合 高扩展 | Spring Security 配置繁琐扩展性极差 | |
||||
|
| 权限注解 | 采用 Sa-Token 支持注解 登录校验、角色校验、权限校验、二级认证校验、HttpBasic校验、忽略校验<br/>角色与权限校验支持多种条件 如 `AND` `OR` 或 `权限 OR 角色` 等复杂表达式 | 只支持是否存在匹配 | |
||||
|
| 关系数据库支持 | 原生支持 MySQL、Oracle、PostgreSQL、SQLServer<br/>可同时使用异构切换(支持其他 mybatis-plus 支持的所有数据库 只需要增加jdbc依赖即可使用 达梦金仓等均有成功案例) | 支持 Mysql、Oracle 不支持同时使用、不支持异构切换 | |
||||
|
| 缓存数据库 | 支持 Redis 5-7 支持大部分新功能特性 如 分布式限流、分布式队列 | Redis 简单 get set 支持 | |
||||
|
| Redis客户端 | 采用 Redisson Redis官方推荐 基于Netty的客户端工具<br/>支持Redis 90%以上的命令 底层优化规避很多不正确的用法 例如: keys被转换为scan<br/>支持单机、哨兵、单主集群、多主集群等模式 | Lettuce + RedisTemplate 支持模式少 工具使用繁琐<br/>连接池采用 common-pool Bug多经常性出问题 | |
||||
|
| 缓存注解 | 采用 Spring-Cache 注解 对其扩展了实现支持了更多功能<br/>例如 过期时间 最大空闲时间 组最大长度等 只需一个注解即可完成数据自动缓存 | 需手动编写Redis代码逻辑 | |
||||
|
| ORM框架 | 采用 Mybatis-Plus 基于对象几乎不用写SQL全java操作 功能强大插件众多<br/>例如多租户插件 分页插件 乐观锁插件等等 | 采用 Mybatis 基于XML需要手写SQL | |
||||
|
| SQL监控 | 采用 p6spy 可输出完整SQL与执行时间监控 | log输出 需手动拼接sql与参数无法快速查看调试问题 | |
||||
|
| 数据分页 | 采用 Mybatis-Plus 分页插件<br/>框架对其进行了扩展 对象化分页对象 支持多种方式传参 支持前端多排序 复杂排序 | 采用 PageHelper 仅支持单查询分页 参数只能从param传 只能单排序 功能扩展性差 体验不好 | |
||||
|
| 数据权限 | 采用 Mybatis-Plus 插件 自行分析拼接SQL 无感式过滤<br/>只需为Mapper设置好注解条件 支持多种自定义 不限于部门角色 | 采用 注解+aop 实现 基于部门角色 生成的sql兼容性差 不支持其他业务扩展<br/>生成sql后需手动拼接到具体业务sql上 对于多个Mapper查询不起作用 | |
||||
|
| 数据脱敏 | 采用 注解 + jackson 序列化期间脱敏 支持不同模块不同的脱敏条件<br/>支持多种策略 如身份证、手机号、地址、邮箱、银行卡等 可自行扩展 | 无 | |
||||
|
| 数据加解密 | 采用 注解 + mybatis 拦截器 对存取数据期间自动加解密<br/>支持多种策略 如BASE64、AES、RSA、SM2、SM4等 | 无 | |
||||
|
| 数据翻译 | 采用 注解 + jackson 序列化期间动态修改数据 数据进行翻译<br/>支持多种模式: `映射翻译` `直接翻译` `其他扩展条件翻译` 接口化两步即可完成自定义扩展 内置多种翻译实现 | 无 | |
||||
|
| 多数据源框架 | 采用 dynamic-datasource 支持市面大部分数据库<br/>通过yml配置即可动态管理异构不同种类的数据库 也可通过前端页面添加数据源<br/>支持spel表达式从请求头参数等条件切换数据源 | 基于 druid 手动编写代码配置数据源 配置繁琐 支持性差 | |
||||
|
| 多数据源事务 | 采用 dynamic-datasource 支持多数据源不同种类的数据库事务回滚 | 不支持 | |
||||
|
| 数据库连接池 | 采用 HikariCP Spring官方内置连接池 配置简单 以性能与稳定性闻名天下 | 采用 druid bug众多 社区维护差 活跃度低 配置众多繁琐性能一般 | |
||||
|
| 数据库主键 | 采用 雪花ID 基于时间戳的 有序增长 唯一ID 再也不用为分库分表 数据合并主键冲突重复而发愁 | 采用 数据库自增ID 支持数据量有限 不支持多数据源主键唯一 | |
||||
|
| WebSocket协议 | 基于 Spring 封装的 WebSocket 协议 扩展了Token鉴权与分布式会话同步 不再只是基于单机的废物 | 无 | |
||||
|
| SSE推送 | 采用 Spring SSE 实现 扩展了Token鉴权与分布式会话同步 | 无 | |
||||
|
| 序列化 | 采用 Jackson Spring官方内置序列化 靠谱!!! | 采用 fastjson bugjson 远近闻名 | |
||||
|
| 分布式幂等 | 参考美团GTIS防重系统简化实现(细节可看文档) | 手动编写注解基于aop实现 | |
||||
|
| 分布式任务调度 | 采用 SnailJob 天生支持分布式 统一的管理中心 支持多种数据库 支持分片重试DAG任务流等 | 采用 Quartz 基于数据库锁性能差 集群需要做很多配置与改造 | |
||||
|
| 分布式日志中心 | 采用 ELK 业界成熟解决方案 实时收集所有服务的运行日志 快速发现定位问题 | 无 | |
||||
|
| 分布式搜索引擎 | 采用 ElasticSearch、Easy-Es 以 Mybatis-Plus 方式操作 ElasticSearch | 无 | |
||||
|
| 分布式消息队列 | 采用 支持 Kafka、RocketMQ、RabbitMQ 各种 延迟消息 事务消息 流消息 | 无 | |
||||
|
| 分布式消息总线 | 采用 SpringCloud Bus 实现事件总线 跨服务通知 支持 Kafka、RocketMQ、RabbitMQ | 无 | |
||||
|
| 分库分表功能 | 采用 Apache Sharding-Proxy 代理服务无入侵支持分库分表 只需编写分库分表规则即可 | 无 | |
||||
|
| 文件存储 | 采用 Minio 分布式文件存储 天生支持多机、多硬盘、多分片、多副本存储<br/>支持权限管理 安全可靠 文件可加密存储 | 采用 本机文件存储 文件裸漏 易丢失泄漏 不支持集群有单点效应 | |
||||
|
| 云存储 | 采用 AWS S3 协议客户端 支持 七牛、阿里、腾讯 等一切支持S3协议的厂家 | 不支持 | |
||||
|
| 短信 | 支持 阿里、腾讯 只需在yml配置好厂家密钥即可使用 接口化支持扩展其他厂家 | 不支持 | |
||||
|
| 邮件 | 采用 mail-api 通用协议支持大部分邮件厂商 | 不支持 | |
||||
|
| 接口文档 | 采用 SpringDoc、javadoc 无注解零入侵基于java注释<br/>只需把注释写好 无需再写一大堆的文档注解了 | 采用 Springfox 已停止维护 需要编写大量的注解来支持文档生成 | |
||||
|
| 校验框架 | 采用 Validation 支持注解与工具类校验 注解支持国际化 | 仅支持注解 且注解不支持国际化 | |
||||
|
| Excel框架 | 采用 Alibaba EasyExcel 基于插件化<br/>框架对其增加了很多功能 例如 自动合并相同内容 自动排列布局 字典翻译等 | 基于 POI 手写实现 功能有限 复杂 扩展性差 | |
||||
|
| 工作流支持 | 支持各种复杂审批 转办 委派 加减签 会签 或签 票签 等功能 | 无 | |
||||
|
| 工具类框架 | 采用 Hutool、Lombok 上百种工具覆盖90%的使用需求 基于注解自动生成 get set 等简化框架大量代码 | 手写工具稳定性差易出问题 工具数量有限 代码臃肿需自己手写 get set 等 | |
||||
|
| 服务监控框架 | 采用 SpringBoot-Admin 基于SpringBoot官方 actuator 探针机制<br/>实时监控服务状态 框架还为其扩展了在线日志查看监控 | 无 | |
||||
|
| 全方位监控报警 | 采用 Prometheus、Grafana 多样化采集 多模板大屏展示 实时报警监控 提供详细的搭建文档 | 无 | |
||||
|
| 链路追踪 | 采用 Apache SkyWalking 还在为请求不知道去哪了 到哪出了问题而烦恼吗<br/>用了它即可实时查看请求经过的每一处每一个节点 | 无 | |
||||
|
| 代码生成器 | 只需设计好表结构 一键生成所有crud代码与页面<br/>降低80%的开发量 把精力都投入到业务设计上<br/>框架为其适配MP、SpringDoc规范化代码 同时支持动态多数据源代码生成 | 代码生成原生结构 只支持单数据源生成 | |
||||
|
| 部署方式 | 支持 Docker 编排 一键搭建所有环境 让开发人员从此不再为搭建环境而烦恼 | 原生jar部署 其他环境需手动下载安装 自行搭建 | |
||||
|
| 项目路径修改 | 提供详细的修改方案文档 并为其做了一些改动 非常简单即可修改成自己想要的 | 需要做很多改造 文档说明有限 | |
||||
|
| 国际化 | 基于请求头动态返回不同语种的文本内容 开发难度低 有对应的工具类 支持大部分注解内容国际化 | 只提供基础功能 其他需自行编写扩展 | |
||||
|
| 代码单例测试 | 提供单例测试 使用方式编写方法与maven多环境单测插件 | 只提供基础功能 其他需自行编写扩展 | |
||||
|
| Demo案例 | 提供框架功能的实际使用案例 单独一个模块提供了很多很全 | 无 | |
||||
|
|
||||
|
## 本框架与RuoYi的业务差异 |
||||
|
|
||||
|
| 业务 | 功能说明 | 本框架 | RuoYi | |
||||
|
|--------|-----------------------------------------|-----|------------------| |
||||
|
| 租户管理 | 系统内租户的管理 如:租户套餐、过期时间、用户数量、企业信息等 | 支持 | 无 | |
||||
|
| 租户套餐管理 | 系统内租户所能使用的套餐管理 如:套餐内所包含的菜单等 | 支持 | 无 | |
||||
|
| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 | |
||||
|
| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 | |
||||
|
| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 | |
||||
|
| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 | |
||||
|
| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 | |
||||
|
| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 | |
||||
|
| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 | |
||||
|
| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 | |
||||
|
| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 | |
||||
|
| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 | |
||||
|
| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 | |
||||
|
| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 | |
||||
|
| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 | |
||||
|
| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 | |
||||
|
| 代码生成 | 多数据源前后端代码的生成(java、html、xml、sql)支持CRUD下载 | 支持 | 仅支持单数据源 | |
||||
|
| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 | |
||||
|
| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 | |
||||
|
| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 | |
||||
|
| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 | |
||||
|
| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 | |
||||
|
|
||||
|
## 参考文档 |
||||
|
|
||||
|
使用框架前请仔细阅读文档重点注意事项 |
||||
|
<br> |
||||
|
>[初始化项目 必看](https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/init) |
||||
|
>>[https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/init](https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/init) |
||||
|
> |
||||
|
>[专栏与视频 入门必看](https://plus-doc.dromara.org/#/common/column) |
||||
|
>>[https://plus-doc.dromara.org/#/common/column](https://plus-doc.dromara.org/#/common/column) |
||||
|
> |
||||
|
>[部署项目 必看](https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/deploy) |
||||
|
>>[https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/deploy](https://plus-doc.dromara.org/#/ruoyi-cloud-plus/quickstart/deploy) |
||||
|
> |
||||
|
>[如何加群](https://plus-doc.dromara.org/#/common/add_group) |
||||
|
>>[https://plus-doc.dromara.org/#/common/add_group](https://plus-doc.dromara.org/#/common/add_group) |
||||
|
> |
||||
|
>[参考文档 Wiki](https://plus-doc.dromara.org) |
||||
|
>>[https://plus-doc.dromara.org](https://plus-doc.dromara.org) |
||||
|
|
||||
|
|
||||
|
## 软件架构图 |
||||
|
|
||||
|
 |
||||
|
|
||||
|
## 贡献代码 |
||||
|
|
||||
|
[参与贡献的方式 https://plus-doc.dromara.org/#/common/contribution](https://plus-doc.dromara.org/#/common/contribution) |
||||
|
|
||||
|
## 捐献作者 |
||||
|
|
||||
|
作者为兼职做开源,平时还需要工作,如果帮到了您可以请作者吃个盒饭 |
||||
|
<img src="https://foruda.gitee.com/images/1678975784848381069/d8661ed9_1766278.png" width="300px" height="450px" /> |
||||
|
<img src="https://foruda.gitee.com/images/1678975801230205215/6f96229d_1766278.png" width="300px" height="450px" /> |
||||
|
|
||||
|
## 演示图例 |
||||
|
|
||||
|
| | | |
||||
|
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|  |  | |
||||
|
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
@ -0,0 +1 @@ |
|||||
|
# 将此文件夹下所有配置文件导入到 `grafana` 内生成展示看板(此模板与项目做了定制化与官方下载的不一致, 同名看板以框架自带的为主) |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1 @@ |
|||||
|
# 将此文件夹下所有配置文件内容复制到 `nacos` 对应的配置中 |
@ -0,0 +1,284 @@ |
|||||
|
server: |
||||
|
# 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 |
||||
|
|
||||
|
dubbo: |
||||
|
application: |
||||
|
# 关闭qos端口避免单机多生产者端口冲突 如需使用自行开启 |
||||
|
qos-enable: false |
||||
|
protocol: |
||||
|
# 如需使用 Triple 3.0 新协议 可查看官方文档 |
||||
|
# 使用 dubbo 协议通信 |
||||
|
name: dubbo |
||||
|
# dubbo 协议端口(-1表示自增端口,从20880开始) |
||||
|
port: -1 |
||||
|
# 指定dubbo协议注册ip |
||||
|
# host: 192.168.0.100 |
||||
|
# 消费者相关配置 |
||||
|
consumer: |
||||
|
# 超时时间 |
||||
|
timeout: 3000 |
||||
|
# 自定义配置 |
||||
|
custom: |
||||
|
# 全局请求log |
||||
|
request-log: true |
||||
|
# info 基础信息 param 参数信息 full 全部 |
||||
|
log-level: info |
||||
|
|
||||
|
spring: |
||||
|
threads: |
||||
|
# 开启虚拟线程 仅jdk21可用 |
||||
|
virtual: |
||||
|
enabled: false |
||||
|
# 资源信息 |
||||
|
messages: |
||||
|
# 国际化资源文件路径 |
||||
|
basename: i18n/messages |
||||
|
servlet: |
||||
|
multipart: |
||||
|
# 整个请求大小限制 |
||||
|
max-request-size: 20MB |
||||
|
# 上传单个文件大小限制 |
||||
|
max-file-size: 10MB |
||||
|
mvc: |
||||
|
# 设置静态资源路径 防止所有请求都去查静态资源 |
||||
|
static-path-pattern: /static/** |
||||
|
format: |
||||
|
date-time: yyyy-MM-dd HH:mm:ss |
||||
|
#jackson配置 |
||||
|
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 |
||||
|
cloud: |
||||
|
nacos: |
||||
|
discovery: |
||||
|
metadata: |
||||
|
# admin 监控账号密码 |
||||
|
username: ruoyi |
||||
|
userpassword: 123456 |
||||
|
# sentinel 配置 |
||||
|
sentinel: |
||||
|
# sentinel 开关 |
||||
|
enabled: true |
||||
|
transport: |
||||
|
# dashboard控制台服务名 用于服务发现 |
||||
|
# 如无此配置将默认使用下方 dashboard 配置直接注册 |
||||
|
server-name: ruoyi-sentinel-dashboard |
||||
|
# 客户端指定注册的ip 用于多网卡ip不稳点使用 |
||||
|
# client-ip: |
||||
|
# 控制台地址 从1.3.0开始使用 server-name 注册 |
||||
|
# dashboard: localhost:8718 |
||||
|
|
||||
|
bus: |
||||
|
id: ${spring.application.name} |
||||
|
base-packages: org.dromara.**.event |
||||
|
# 消息总线 也可以使用 kafka 参考 spring-cloud-bus 用法 |
||||
|
rabbitmq: |
||||
|
host: localhost |
||||
|
port: 5672 |
||||
|
username: ruoyi |
||||
|
password: ruoyi123 |
||||
|
|
||||
|
# redis通用配置 子服务可以自行配置进行覆盖 |
||||
|
data: |
||||
|
redis: |
||||
|
host: localhost |
||||
|
port: 6379 |
||||
|
# redis 密码必须配置 |
||||
|
password: ruoyi123 |
||||
|
database: 0 |
||||
|
# 需要使用数字 |
||||
|
timeout: 10000 |
||||
|
ssl.enabled: false |
||||
|
|
||||
|
# redisson 配置 |
||||
|
redisson: |
||||
|
# redis key前缀 |
||||
|
keyPrefix: |
||||
|
# 线程池数量 |
||||
|
threads: 4 |
||||
|
# Netty线程池数量 |
||||
|
nettyThreads: 8 |
||||
|
# 单节点配置 |
||||
|
singleServerConfig: |
||||
|
# 客户端名称 |
||||
|
clientName: ${spring.application.name} |
||||
|
# 最小空闲连接数 |
||||
|
connectionMinimumIdleSize: 8 |
||||
|
# 连接池大小 |
||||
|
connectionPoolSize: 32 |
||||
|
# 连接空闲超时,单位:毫秒 |
||||
|
idleConnectionTimeout: 10000 |
||||
|
# 命令等待超时,单位:毫秒 |
||||
|
timeout: 3000 |
||||
|
# 发布和订阅连接池大小 |
||||
|
subscriptionConnectionPoolSize: 50 |
||||
|
|
||||
|
# 分布式锁 lock4j 全局配置 |
||||
|
lock4j: |
||||
|
# 获取分布式锁超时时间,默认为 3000 毫秒 |
||||
|
acquire-timeout: 3000 |
||||
|
# 分布式锁的超时时间,默认为 30 秒 |
||||
|
expire: 30000 |
||||
|
|
||||
|
# 暴露监控端点 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
include: '*' |
||||
|
endpoint: |
||||
|
health: |
||||
|
show-details: ALWAYS |
||||
|
logfile: |
||||
|
external-file: ./logs/${spring.application.name}/console.log |
||||
|
|
||||
|
# 日志配置 |
||||
|
logging: |
||||
|
level: |
||||
|
org.springframework: warn |
||||
|
org.apache.dubbo: warn |
||||
|
com.alibaba.nacos: warn |
||||
|
com.alibaba.cloud.sentinel: warn |
||||
|
org.mybatis.spring.mapper: error |
||||
|
org.apache.dubbo.config: error |
||||
|
# 临时处理 spring 调整日志级别导致启动警告问题 不影响使用等待 alibaba 适配 |
||||
|
org.springframework.context.support.PostProcessorRegistrationDelegate: error |
||||
|
config: classpath:logback-plus.xml |
||||
|
|
||||
|
# Sa-Token配置 |
||||
|
sa-token: |
||||
|
# token名称 (同时也是cookie名称) |
||||
|
token-name: Authorization |
||||
|
# 开启内网服务调用鉴权(不允许越过gateway访问内网服务 保障服务安全) |
||||
|
check-same-token: true |
||||
|
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) |
||||
|
is-concurrent: true |
||||
|
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) |
||||
|
is-share: false |
||||
|
# jwt秘钥 |
||||
|
jwt-secret-key: abcdefghijklmnopqrstuvwxyz |
||||
|
|
||||
|
# MyBatisPlus配置 |
||||
|
# https://baomidou.com/config/ |
||||
|
mybatis-plus: |
||||
|
# 多包名使用 例如 org.dromara.**.mapper,org.xxx.**.mapper |
||||
|
mapperPackage: org.dromara.**.mapper |
||||
|
# 对应的 XML 文件位置 |
||||
|
mapperLocations: classpath*:mapper/**/*Mapper.xml |
||||
|
# 实体扫描,多个package用逗号或者分号分隔 |
||||
|
typeAliasesPackage: org.dromara.**.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= |
||||
|
|
||||
|
# 防止XSS攻击 |
||||
|
xss: |
||||
|
enabled: true |
||||
|
excludeUrls: |
||||
|
- /system/notice |
||||
|
- /workflow/model/save |
||||
|
- /workflow/model/editModelXml |
||||
|
|
||||
|
# 接口文档配置 |
||||
|
springdoc: |
||||
|
api-docs: |
||||
|
# 是否开启接口文档 |
||||
|
enabled: true |
||||
|
# swagger-ui: |
||||
|
# # 持久化认证数据 |
||||
|
# persistAuthorization: true |
||||
|
info: |
||||
|
# 标题 |
||||
|
title: '标题:RuoYi-Cloud-Plus微服务权限管理系统_接口文档' |
||||
|
# 描述 |
||||
|
description: '描述:微服务权限管理系统, 具体包括XXX,XXX模块...' |
||||
|
# 版本 |
||||
|
version: '版本号:系统版本...' |
||||
|
# 作者信息 |
||||
|
contact: |
||||
|
name: Lion Li |
||||
|
email: crazylionli@163.com |
||||
|
url: https://gitee.com/dromara/RuoYi-Cloud-Plus |
||||
|
components: |
||||
|
# 鉴权方式配置 |
||||
|
security-schemes: |
||||
|
apiKey: |
||||
|
type: APIKEY |
||||
|
in: HEADER |
||||
|
name: ${sa-token.token-name} |
||||
|
|
||||
|
# seata配置 |
||||
|
seata: |
||||
|
# 是否启用 |
||||
|
enabled: true |
||||
|
# Seata 应用编号,默认为应用名 |
||||
|
application-id: ${spring.application.name} |
||||
|
# Seata 事务组编号,用于 TC 集群名 |
||||
|
tx-service-group: ${spring.application.name}-group |
||||
|
|
||||
|
# 多租户配置 |
||||
|
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 |
@ -0,0 +1,54 @@ |
|||||
|
datasource: |
||||
|
system-master: |
||||
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
||||
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能 |
||||
|
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
username: root |
||||
|
password: password |
||||
|
gen: |
||||
|
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
username: root |
||||
|
password: password |
||||
|
job: |
||||
|
url: jdbc:mysql://localhost:3306/ry-job?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
username: root |
||||
|
password: password |
||||
|
workflow: |
||||
|
url: jdbc:mysql://localhost:3306/ry-workflow?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
||||
|
username: root |
||||
|
password: password |
||||
|
# system-oracle: |
||||
|
# url: jdbc:oracle:thin:@//localhost:1521/XE |
||||
|
# username: ROOT |
||||
|
# password: password |
||||
|
# system-postgres: |
||||
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true |
||||
|
# username: root |
||||
|
# password: password |
||||
|
|
||||
|
spring: |
||||
|
datasource: |
||||
|
type: com.zaxxer.hikari.HikariDataSource |
||||
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content |
||||
|
dynamic: |
||||
|
# 性能分析插件(有性能损耗 不建议生产环境使用) |
||||
|
p6spy: true |
||||
|
# 开启seata代理,开启后默认每个数据源都代理,如果某个不需要代理可单独关闭 |
||||
|
seata: ${seata.enabled} |
||||
|
# 严格模式 匹配不到数据源则报错 |
||||
|
strict: true |
||||
|
hikari: |
||||
|
# 最大连接池数量 |
||||
|
maxPoolSize: 20 |
||||
|
# 最小空闲线程数量 |
||||
|
minIdle: 10 |
||||
|
# 配置获取连接等待超时的时间 |
||||
|
connectionTimeout: 30000 |
||||
|
# 校验超时时间 |
||||
|
validationTimeout: 5000 |
||||
|
# 空闲连接存活最大时间,默认10分钟 |
||||
|
idleTimeout: 600000 |
||||
|
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 |
||||
|
maxLifetime: 1800000 |
||||
|
# 多久检查一次连接的活性 |
||||
|
keepaliveTime: 30000 |
@ -0,0 +1,98 @@ |
|||||
|
# 安全配置 |
||||
|
security: |
||||
|
# 验证码 |
||||
|
captcha: |
||||
|
# 是否开启验证码 |
||||
|
enabled: true |
||||
|
# 验证码类型 math 数组计算 char 字符验证 |
||||
|
type: MATH |
||||
|
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰 |
||||
|
category: CIRCLE |
||||
|
# 数字验证码位数 |
||||
|
numberLength: 1 |
||||
|
# 字符验证码长度 |
||||
|
charLength: 4 |
||||
|
|
||||
|
# 用户配置 |
||||
|
user: |
||||
|
password: |
||||
|
# 密码最大错误次数 |
||||
|
maxRetryCount: 5 |
||||
|
# 密码锁定时间(默认10分钟) |
||||
|
lockTime: 10 |
||||
|
|
||||
|
# 三方授权 |
||||
|
justauth: |
||||
|
# 前端外网访问地址 |
||||
|
address: http://localhost:80 |
||||
|
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:1989/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: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98 |
||||
|
client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac |
||||
|
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 |
@ -0,0 +1,95 @@ |
|||||
|
# 安全配置 |
||||
|
security: |
||||
|
# 不校验白名单 |
||||
|
ignore: |
||||
|
whites: |
||||
|
- /auth/code |
||||
|
- /auth/logout |
||||
|
- /auth/login |
||||
|
- /auth/binding/* |
||||
|
- /auth/social/callback |
||||
|
- /auth/register |
||||
|
- /auth/tenant/list |
||||
|
- /resource/sms/code |
||||
|
- /resource/sse/close |
||||
|
- /*/v3/api-docs |
||||
|
- /*/error |
||||
|
- /csrf |
||||
|
|
||||
|
spring: |
||||
|
cloud: |
||||
|
# 网关配置 |
||||
|
gateway: |
||||
|
# 打印请求日志(自定义) |
||||
|
requestLog: true |
||||
|
discovery: |
||||
|
locator: |
||||
|
lowerCaseServiceId: true |
||||
|
enabled: true |
||||
|
routes: |
||||
|
# 认证中心 |
||||
|
- id: ruoyi-auth |
||||
|
uri: lb://ruoyi-auth |
||||
|
predicates: |
||||
|
- Path=/auth/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# 代码生成 |
||||
|
- id: ruoyi-gen |
||||
|
uri: lb://ruoyi-gen |
||||
|
predicates: |
||||
|
- Path=/tool/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# 系统模块 |
||||
|
- id: ruoyi-system |
||||
|
uri: lb://ruoyi-system |
||||
|
predicates: |
||||
|
- Path=/system/**,/monitor/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# 资源服务 |
||||
|
- id: ruoyi-resource |
||||
|
uri: lb://ruoyi-resource |
||||
|
predicates: |
||||
|
- Path=/resource/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# workflow服务 |
||||
|
- id: ruoyi-workflow |
||||
|
uri: lb://ruoyi-workflow |
||||
|
predicates: |
||||
|
- Path=/workflow/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# 演示服务 |
||||
|
- id: ruoyi-demo |
||||
|
uri: lb://ruoyi-demo |
||||
|
predicates: |
||||
|
- Path=/demo/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
# MQ演示服务 |
||||
|
- id: ruoyi-test-mq |
||||
|
uri: lb://ruoyi-test-mq |
||||
|
predicates: |
||||
|
- Path=/test-mq/** |
||||
|
filters: |
||||
|
- StripPrefix=1 |
||||
|
|
||||
|
# sentinel 配置 |
||||
|
sentinel: |
||||
|
filter: |
||||
|
enabled: false |
||||
|
# nacos配置持久化 |
||||
|
datasource: |
||||
|
ds1: |
||||
|
nacos: |
||||
|
server-addr: ${spring.cloud.nacos.server-addr} |
||||
|
dataId: sentinel-${spring.application.name}.json |
||||
|
groupId: ${spring.cloud.nacos.config.group} |
||||
|
username: ${spring.cloud.nacos.username} |
||||
|
password: ${spring.cloud.nacos.password} |
||||
|
namespace: ${spring.profiles.active} |
||||
|
data-type: json |
||||
|
rule-type: gw-flow |
@ -0,0 +1,37 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
dynamic: |
||||
|
# 设置默认的数据源或者数据源组,默认值即为 master |
||||
|
primary: master |
||||
|
seata: false |
||||
|
datasource: |
||||
|
# 主库数据源 |
||||
|
master: |
||||
|
type: ${spring.datasource.type} |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.system-master.url} |
||||
|
username: ${datasource.system-master.username} |
||||
|
password: ${datasource.system-master.password} |
||||
|
# oracle: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: oracle.jdbc.OracleDriver |
||||
|
# url: ${datasource.system-oracle.url} |
||||
|
# username: ${datasource.system-oracle.username} |
||||
|
# password: ${datasource.system-oracle.password} |
||||
|
# postgres: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: org.postgresql.Driver |
||||
|
# url: ${datasource.system-postgres.url} |
||||
|
# username: ${datasource.system-postgres.username} |
||||
|
# password: ${datasource.system-postgres.password} |
||||
|
|
||||
|
# 代码生成 |
||||
|
gen: |
||||
|
# 作者 |
||||
|
author: LionLi |
||||
|
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool |
||||
|
packageName: org.dromara.system |
||||
|
# 自动去除表前缀,默认是false |
||||
|
autoRemovePre: false |
||||
|
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔) |
||||
|
tablePrefix: sys_ |
@ -0,0 +1,33 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
dynamic: |
||||
|
# 设置默认的数据源或者数据源组,默认值即为 master |
||||
|
primary: master |
||||
|
seata: false |
||||
|
datasource: |
||||
|
# 主库数据源 |
||||
|
master: |
||||
|
type: ${spring.datasource.type} |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.job.url} |
||||
|
username: ${datasource.job.username} |
||||
|
password: ${datasource.job.password} |
||||
|
|
||||
|
snail-job: |
||||
|
enabled: true |
||||
|
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务 |
||||
|
group: "ruoyi_group" |
||||
|
# SnailJob 接入验证令牌 |
||||
|
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT" |
||||
|
server: |
||||
|
# 从 nacos 获取服务 |
||||
|
server-name: ruoyi-snailjob-server |
||||
|
# 服务名优先 ip垫底 |
||||
|
host: 127.0.0.1 |
||||
|
port: 17888 |
||||
|
# 详见 script/sql/ry_job.sql `sj_namespace` 表 |
||||
|
namespace: ${spring.profiles.active} |
||||
|
# 随主应用端口飘逸 |
||||
|
port: 2${server.port} |
||||
|
# 客户端ip指定 |
||||
|
host: |
@ -0,0 +1,13 @@ |
|||||
|
# 监控中心配置 |
||||
|
spring: |
||||
|
security: |
||||
|
user: |
||||
|
name: ruoyi |
||||
|
password: 123456 |
||||
|
boot: |
||||
|
admin: |
||||
|
ui: |
||||
|
title: RuoYi-Cloud-Plus服务监控中心 |
||||
|
discovery: |
||||
|
# seata 不具有健康检查的能力 防止报错排除掉 |
||||
|
ignored-services: ruoyi-seata-server |
@ -0,0 +1,91 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
dynamic: |
||||
|
# 设置默认的数据源或者数据源组,默认值即为 master |
||||
|
primary: master |
||||
|
datasource: |
||||
|
# 主库数据源 |
||||
|
master: |
||||
|
type: ${spring.datasource.type} |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.system-master.url} |
||||
|
username: ${datasource.system-master.username} |
||||
|
password: ${datasource.system-master.password} |
||||
|
# oracle: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: oracle.jdbc.OracleDriver |
||||
|
# url: ${datasource.system-oracle.url} |
||||
|
# username: ${datasource.system-oracle.username} |
||||
|
# password: ${datasource.system-oracle.password} |
||||
|
# postgres: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: org.postgresql.Driver |
||||
|
# url: ${datasource.system-postgres.url} |
||||
|
# username: ${datasource.system-postgres.username} |
||||
|
# password: ${datasource.system-postgres.password} |
||||
|
|
||||
|
# 默认/推荐使用sse推送 |
||||
|
sse: |
||||
|
enabled: true |
||||
|
path: /sse |
||||
|
|
||||
|
websocket: |
||||
|
# 如果关闭 需要和前端开关一起关闭 |
||||
|
enabled: false |
||||
|
# 路径 |
||||
|
path: /websocket |
||||
|
# 设置访问源地址 |
||||
|
allowedOrigins: '*' |
||||
|
|
||||
|
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 |
@ -0,0 +1,27 @@ |
|||||
|
spring: |
||||
|
mvc: |
||||
|
pathmatch: |
||||
|
# 修复 sentinel 控制台未适配 springboot 2.6 新路由方式 |
||||
|
matching-strategy: ANT_PATH_MATCHER |
||||
|
|
||||
|
server: |
||||
|
servlet: |
||||
|
encoding: |
||||
|
force: true |
||||
|
charset: UTF-8 |
||||
|
enabled: true |
||||
|
session: |
||||
|
cookie: |
||||
|
name: sentinel_dashboard_cookie |
||||
|
|
||||
|
logging: |
||||
|
level: |
||||
|
org.springframework.web: INFO |
||||
|
|
||||
|
auth: |
||||
|
enabled: true |
||||
|
filter: |
||||
|
exclude-urls: /,/auth/login,/auth/logout,/registry/machine,/version,/actuator,/actuator/** |
||||
|
exclude-url-suffixes: htm,html,js,css,map,ico,ttf,woff,png |
||||
|
username: sentinel |
||||
|
password: sentinel |
@ -0,0 +1,48 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
type: com.zaxxer.hikari.HikariDataSource |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.job.url} |
||||
|
username: ${datasource.job.username} |
||||
|
password: ${datasource.job.password} |
||||
|
hikari: |
||||
|
connection-timeout: 30000 |
||||
|
validation-timeout: 5000 |
||||
|
minimum-idle: 10 |
||||
|
maximum-pool-size: 20 |
||||
|
idle-timeout: 600000 |
||||
|
max-lifetime: 900000 |
||||
|
keepaliveTime: 30000 |
||||
|
cloud: |
||||
|
nacos: |
||||
|
discovery: |
||||
|
metadata: |
||||
|
# 解决 er 服务有 context-path 无法监控问题 |
||||
|
management.context-path: ${server.servlet.context-path}/actuator |
||||
|
# 监控账号密码 |
||||
|
username: ruoyi |
||||
|
userpassword: 123456 |
||||
|
|
||||
|
# snail-job 服务端配置 |
||||
|
snail-job: |
||||
|
# 拉取重试数据的每批次的大小 |
||||
|
retry-pull-page-size: 1000 |
||||
|
# 拉取重试数据的每批次的大小 |
||||
|
job-pull-page-size: 1000 |
||||
|
# 服务端 netty 端口 |
||||
|
netty-port: 17888 |
||||
|
# 重试和死信表的分区总数 |
||||
|
total-partition: 2 |
||||
|
# 一个客户端每秒最多接收的重试数量指令 |
||||
|
limiter: 1000 |
||||
|
# 号段模式下步长配置 |
||||
|
step: 100 |
||||
|
# 日志保存时间(单位: day) |
||||
|
log-storage: 90 |
||||
|
# 回调配置 |
||||
|
callback: |
||||
|
#回调最大执行次数 |
||||
|
max-count: 288 |
||||
|
#间隔时间 |
||||
|
trigger-interval: 900 |
||||
|
retry-max-pull-count: 10 |
@ -0,0 +1,25 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
dynamic: |
||||
|
# 设置默认的数据源或者数据源组,默认值即为 master |
||||
|
primary: master |
||||
|
datasource: |
||||
|
# 主库数据源 |
||||
|
master: |
||||
|
type: ${spring.datasource.type} |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.system-master.url} |
||||
|
username: ${datasource.system-master.username} |
||||
|
password: ${datasource.system-master.password} |
||||
|
# oracle: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: oracle.jdbc.OracleDriver |
||||
|
# url: ${datasource.system-oracle.url} |
||||
|
# username: ${datasource.system-oracle.username} |
||||
|
# password: ${datasource.system-oracle.password} |
||||
|
# postgres: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: org.postgresql.Driver |
||||
|
# url: ${datasource.system-postgres.url} |
||||
|
# username: ${datasource.system-postgres.username} |
||||
|
# password: ${datasource.system-postgres.password} |
@ -0,0 +1,48 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
dynamic: |
||||
|
# 设置默认的数据源或者数据源组,默认值即为 master |
||||
|
primary: master |
||||
|
datasource: |
||||
|
# 主库数据源 |
||||
|
master: |
||||
|
type: ${spring.datasource.type} |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: ${datasource.workflow.url} |
||||
|
username: ${datasource.workflow.username} |
||||
|
password: ${datasource.workflow.password} |
||||
|
# oracle: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: oracle.jdbc.OracleDriver |
||||
|
# url: ${datasource.system-oracle.url} |
||||
|
# username: ${datasource.system-oracle.username} |
||||
|
# password: ${datasource.system-oracle.password} |
||||
|
# postgres: |
||||
|
# type: ${spring.datasource.type} |
||||
|
# driverClassName: org.postgresql.Driver |
||||
|
# url: ${datasource.system-postgres.url} |
||||
|
# username: ${datasource.system-postgres.username} |
||||
|
# password: ${datasource.system-postgres.password} |
||||
|
|
||||
|
# flowable配置 |
||||
|
flowable: |
||||
|
# 开关 用于启动/停用工作流 |
||||
|
enabled: true |
||||
|
process.enabled: ${flowable.enabled} |
||||
|
eventregistry.enabled: ${flowable.enabled} |
||||
|
# 关闭定时任务JOB |
||||
|
async-executor-activate: false |
||||
|
# 将databaseSchemaUpdate设置为true。当Flowable发现库与数据库表结构不一致时,会自动将数据库表结构升级至新版本。 |
||||
|
database-schema-update: true |
||||
|
activity-font-name: 宋体 |
||||
|
label-font-name: 宋体 |
||||
|
annotation-font-name: 宋体 |
||||
|
# 关闭各个模块生成表,目前只使用工作流基础表 |
||||
|
idm: |
||||
|
enabled: false |
||||
|
cmmn: |
||||
|
enabled: false |
||||
|
dmn: |
||||
|
enabled: false |
||||
|
app: |
||||
|
enabled: false |
@ -0,0 +1,121 @@ |
|||||
|
service.vgroupMapping.ruoyi-auth-group=default |
||||
|
service.vgroupMapping.ruoyi-system-group=default |
||||
|
service.vgroupMapping.ruoyi-resource-group=default |
||||
|
service.vgroupMapping.ruoyi-workflow-group=default |
||||
|
|
||||
|
service.enableDegrade=false |
||||
|
service.disableGlobalTransaction=false |
||||
|
|
||||
|
#Transaction storage configuration, only for the server. The file, DB, and redis configuration values are optional. |
||||
|
store.mode=db |
||||
|
store.lock.mode=db |
||||
|
store.session.mode=db |
||||
|
#Used for password encryption |
||||
|
#store.publicKey= |
||||
|
|
||||
|
#These configurations are required if the `store mode` is `db`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `db`, you can remove the configuration block. |
||||
|
store.db.datasource=hikari |
||||
|
store.db.dbType=mysql |
||||
|
store.db.driverClassName=com.mysql.cj.jdbc.Driver |
||||
|
store.db.url=jdbc:mysql://127.0.0.1:3306/ry-seata?useUnicode=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
store.db.user=root |
||||
|
store.db.password=root |
||||
|
store.db.minConn=5 |
||||
|
store.db.maxConn=30 |
||||
|
store.db.globalTable=global_table |
||||
|
store.db.branchTable=branch_table |
||||
|
store.db.distributedLockTable=distributed_lock |
||||
|
store.db.queryLimit=100 |
||||
|
store.db.lockTable=lock_table |
||||
|
store.db.maxWait=5000 |
||||
|
|
||||
|
# redis 模式 store.mode=redis 开启 (控制台查询功能有限,不影响实际执行功能) |
||||
|
# store.redis.host=127.0.0.1 |
||||
|
# store.redis.port=6379 |
||||
|
# 最大连接数 |
||||
|
# store.redis.maxConn=10 |
||||
|
# 最小连接数 |
||||
|
# store.redis.minConn=1 |
||||
|
# store.redis.database=0 |
||||
|
# store.redis.password= |
||||
|
# store.redis.queryLimit=100 |
||||
|
|
||||
|
#Transaction rule configuration, only for the server |
||||
|
server.recovery.committingRetryPeriod=1000 |
||||
|
server.recovery.asynCommittingRetryPeriod=1000 |
||||
|
server.recovery.rollbackingRetryPeriod=1000 |
||||
|
server.recovery.timeoutRetryPeriod=1000 |
||||
|
server.maxCommitRetryTimeout=-1 |
||||
|
server.maxRollbackRetryTimeout=-1 |
||||
|
server.rollbackRetryTimeoutUnlockEnable=false |
||||
|
server.distributedLockExpireTime=10000 |
||||
|
server.xaerNotaRetryTimeout=60000 |
||||
|
server.session.branchAsyncQueueSize=5000 |
||||
|
server.session.enableBranchAsyncRemove=false |
||||
|
|
||||
|
#Transaction rule configuration, only for the client |
||||
|
client.rm.asyncCommitBufferLimit=10000 |
||||
|
client.rm.lock.retryInterval=10 |
||||
|
client.rm.lock.retryTimes=30 |
||||
|
client.rm.lock.retryPolicyBranchRollbackOnConflict=true |
||||
|
client.rm.reportRetryCount=5 |
||||
|
client.rm.tableMetaCheckEnable=true |
||||
|
client.rm.tableMetaCheckerInterval=60000 |
||||
|
client.rm.sqlParserType=druid |
||||
|
client.rm.reportSuccessEnable=false |
||||
|
client.rm.sagaBranchRegisterEnable=false |
||||
|
client.rm.sagaJsonParser=fastjson |
||||
|
client.rm.tccActionInterceptorOrder=-2147482648 |
||||
|
client.tm.commitRetryCount=5 |
||||
|
client.tm.rollbackRetryCount=5 |
||||
|
client.tm.defaultGlobalTransactionTimeout=60000 |
||||
|
client.tm.degradeCheck=false |
||||
|
client.tm.degradeCheckAllowTimes=10 |
||||
|
client.tm.degradeCheckPeriod=2000 |
||||
|
client.tm.interceptorOrder=-2147482648 |
||||
|
client.undo.dataValidation=true |
||||
|
client.undo.logSerialization=jackson |
||||
|
client.undo.onlyCareUpdateColumns=true |
||||
|
server.undo.logSaveDays=7 |
||||
|
server.undo.logDeletePeriod=86400000 |
||||
|
client.undo.logTable=undo_log |
||||
|
client.undo.compress.enable=true |
||||
|
client.undo.compress.type=zip |
||||
|
client.undo.compress.threshold=64k |
||||
|
|
||||
|
#For TCC transaction mode |
||||
|
tcc.fence.logTableName=tcc_fence_log |
||||
|
tcc.fence.cleanPeriod=1h |
||||
|
|
||||
|
#Log rule configuration, for client and server |
||||
|
log.exceptionRate=100 |
||||
|
|
||||
|
#Metrics configuration, only for the server |
||||
|
metrics.enabled=false |
||||
|
metrics.registryType=compact |
||||
|
metrics.exporterList=prometheus |
||||
|
metrics.exporterPrometheusPort=9898 |
||||
|
|
||||
|
#For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html |
||||
|
#Transport configuration, for client and server |
||||
|
transport.type=TCP |
||||
|
transport.server=NIO |
||||
|
transport.heartbeat=true |
||||
|
transport.enableTmClientBatchSendRequest=false |
||||
|
transport.enableRmClientBatchSendRequest=true |
||||
|
transport.enableTcServerBatchSendResponse=false |
||||
|
transport.rpcRmRequestTimeout=30000 |
||||
|
transport.rpcTmRequestTimeout=30000 |
||||
|
transport.rpcTcRequestTimeout=30000 |
||||
|
transport.threadFactory.bossThreadPrefix=NettyBoss |
||||
|
transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker |
||||
|
transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler |
||||
|
transport.threadFactory.shareBossWorker=false |
||||
|
transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector |
||||
|
transport.threadFactory.clientSelectorThreadSize=1 |
||||
|
transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread |
||||
|
transport.threadFactory.bossThreadSize=1 |
||||
|
transport.threadFactory.workerThreadSize=default |
||||
|
transport.shutdown.wait=3 |
||||
|
transport.serialization=seata |
||||
|
transport.compressor=none |
@ -0,0 +1,26 @@ |
|||||
|
[ |
||||
|
{ |
||||
|
"resource": "ruoyi-auth", |
||||
|
"count": 500, |
||||
|
"grade": 1, |
||||
|
"limitApp": "default", |
||||
|
"strategy": 0, |
||||
|
"controlBehavior": 0 |
||||
|
}, |
||||
|
{ |
||||
|
"resource": "ruoyi-system", |
||||
|
"count": 1000, |
||||
|
"grade": 1, |
||||
|
"limitApp": "default", |
||||
|
"strategy": 0, |
||||
|
"controlBehavior": 0 |
||||
|
}, |
||||
|
{ |
||||
|
"resource": "ruoyi-resource", |
||||
|
"count": 500, |
||||
|
"grade": 1, |
||||
|
"limitApp": "default", |
||||
|
"strategy": 0, |
||||
|
"controlBehavior": 0 |
||||
|
} |
||||
|
] |
@ -0,0 +1,46 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
|
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>api-bom</artifactId> |
||||
|
<packaging>pom</packaging> |
||||
|
<version>${revision}</version> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-api-bom api依赖项 |
||||
|
</description> |
||||
|
|
||||
|
<properties> |
||||
|
<revision>2.2.2</revision> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<!-- 系统接口 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>api-system</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 资源服务接口 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>api-resource</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- workflow接口 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>api-workflow</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
</project> |
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk-api</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>ruoyi-api-resource</artifactId> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-api-resource 资源服务接口模块 |
||||
|
</description> |
||||
|
|
||||
|
<dependencies> |
||||
|
|
||||
|
<!-- RuoYi Common Core--> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-core</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.resource.api.domain.RemoteFile; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 文件服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteFileService { |
||||
|
|
||||
|
/** |
||||
|
* 上传文件 |
||||
|
* |
||||
|
* @param file 文件信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
RemoteFile upload(String name, String originalFilename, String contentType, byte[] file) throws ServiceException; |
||||
|
|
||||
|
/** |
||||
|
* 通过ossId查询对应的url |
||||
|
* |
||||
|
* @param ossIds ossId串逗号分隔 |
||||
|
* @return url串逗号分隔 |
||||
|
*/ |
||||
|
String selectUrlByIds(String ossIds); |
||||
|
|
||||
|
/** |
||||
|
* 通过ossId查询列表 |
||||
|
* |
||||
|
* @param ossIds ossId串逗号分隔 |
||||
|
* @return 列表 |
||||
|
*/ |
||||
|
List<RemoteFile> selectByIds(String ossIds); |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.resource.api.domain.RemoteFile; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 文件服务(降级处理) |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
public class RemoteFileServiceMock implements RemoteFileService { |
||||
|
|
||||
|
/** |
||||
|
* 上传文件 |
||||
|
* |
||||
|
* @param file 文件信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public RemoteFile upload(String name, String originalFilename, String contentType, byte[] file) { |
||||
|
log.warn("服务调用异常 -> 降级处理"); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 通过ossId查询对应的url |
||||
|
* |
||||
|
* @param ossIds ossId串逗号分隔 |
||||
|
* @return url串逗号分隔 |
||||
|
*/ |
||||
|
@Override |
||||
|
public String selectUrlByIds(String ossIds) { |
||||
|
log.warn("服务调用异常 -> 降级处理"); |
||||
|
return StringUtils.EMPTY; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 通过ossId查询列表 |
||||
|
* |
||||
|
* @param ossIds ossId串逗号分隔 |
||||
|
* @return 列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<RemoteFile> selectByIds(String ossIds) { |
||||
|
log.warn("服务调用异常 -> 降级处理"); |
||||
|
return List.of(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
|
||||
|
/** |
||||
|
* 邮件服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteMailService { |
||||
|
|
||||
|
/** |
||||
|
* 发送邮件 |
||||
|
* |
||||
|
* @param to 接收人 |
||||
|
* @param subject 标题 |
||||
|
* @param text 内容 |
||||
|
*/ |
||||
|
void send(String to, String subject, String text) throws ServiceException; |
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
/** |
||||
|
* 消息服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteMessageService { |
||||
|
|
||||
|
/** |
||||
|
* 发送消息 |
||||
|
* |
||||
|
* @param sessionKey session主键 一般为用户id |
||||
|
* @param message 消息文本 |
||||
|
*/ |
||||
|
void publishMessage(Long sessionKey, String message); |
||||
|
|
||||
|
/** |
||||
|
* 发布订阅的消息(群发) |
||||
|
* |
||||
|
* @param message 消息内容 |
||||
|
*/ |
||||
|
void publishAll(String message); |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
|
||||
|
/** |
||||
|
* 消息服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@RequiredArgsConstructor |
||||
|
public class RemoteMessageServiceStub implements RemoteMessageService { |
||||
|
|
||||
|
private final RemoteMessageService remoteMessageService; |
||||
|
|
||||
|
/** |
||||
|
* 发送消息 |
||||
|
* |
||||
|
* @param sessionKey session主键 一般为用户id |
||||
|
* @param message 消息文本 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void publishMessage(Long sessionKey, String message) { |
||||
|
try { |
||||
|
remoteMessageService.publishMessage(sessionKey, message); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("推送功能未开启或服务未找到"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发布订阅的消息(群发) |
||||
|
* |
||||
|
* @param message 消息内容 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void publishAll(String message) { |
||||
|
try { |
||||
|
remoteMessageService.publishAll(message); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("推送功能未开启或服务未找到"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,145 @@ |
|||||
|
package org.dromara.resource.api; |
||||
|
|
||||
|
import org.dromara.resource.api.domain.RemoteSms; |
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 短信服务 |
||||
|
* |
||||
|
* @author Feng |
||||
|
*/ |
||||
|
public interface RemoteSmsService { |
||||
|
|
||||
|
/** |
||||
|
* 同步方法:发送固定消息模板短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param message 短信内容 |
||||
|
* @return 封装了短信发送结果的 RemoteSms 对象 |
||||
|
*/ |
||||
|
RemoteSms sendMessage(String phone, String message); |
||||
|
|
||||
|
/** |
||||
|
* 同步方法:发送固定消息模板多模板参数短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
* @return 封装了短信发送结果的 RemoteSms 对象 |
||||
|
*/ |
||||
|
RemoteSms sendMessage(String phone, LinkedHashMap<String, String> messages); |
||||
|
|
||||
|
/** |
||||
|
* 同步方法:使用自定义模板发送短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param templateId 短信模板ID |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
* @return 封装了短信发送结果的 RemoteSms 对象 |
||||
|
*/ |
||||
|
RemoteSms sendMessage(String phone, String templateId, LinkedHashMap<String, String> messages); |
||||
|
|
||||
|
/** |
||||
|
* 同步方法:群发固定模板短信 |
||||
|
* |
||||
|
* @param phones 目标手机号列表(1~1000) |
||||
|
* @param message 短信内容 |
||||
|
* @return 封装了短信发送结果的 RemoteSms 对象 |
||||
|
*/ |
||||
|
RemoteSms messageTexting(List<String> phones, String message); |
||||
|
|
||||
|
/** |
||||
|
* 同步方法:使用自定义模板群发短信 |
||||
|
* |
||||
|
* @param phones 目标手机号列表(1~1000)(1~1000) |
||||
|
* @param templateId 短信模板ID |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
* @return 封装了短信发送结果的 RemoteSms 对象 |
||||
|
*/ |
||||
|
RemoteSms messageTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages); |
||||
|
|
||||
|
/** |
||||
|
* 异步方法:发送固定消息模板短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param message 短信内容 |
||||
|
*/ |
||||
|
void sendMessageAsync(String phone, String message); |
||||
|
|
||||
|
/** |
||||
|
* 异步方法:使用自定义模板发送短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param templateId 短信模板ID |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
*/ |
||||
|
void sendMessageAsync(String phone, String templateId, LinkedHashMap<String, String> messages); |
||||
|
|
||||
|
/** |
||||
|
* 延迟发送:发送固定消息模板短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param message 短信内容 |
||||
|
* @param delayedTime 延迟发送时间(毫秒) |
||||
|
*/ |
||||
|
void delayMessage(String phone, String message, Long delayedTime); |
||||
|
|
||||
|
/** |
||||
|
* 延迟发送:使用自定义模板发送定时短信 |
||||
|
* |
||||
|
* @param phone 目标手机号 |
||||
|
* @param templateId 短信模板ID |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
* @param delayedTime 延迟发送时间(毫秒) |
||||
|
*/ |
||||
|
void delayMessage(String phone, String templateId, LinkedHashMap<String, String> messages, Long delayedTime); |
||||
|
|
||||
|
/** |
||||
|
* 延迟群发:群发延迟短信 |
||||
|
* |
||||
|
* @param phones 目标手机号列表(1~1000) |
||||
|
* @param message 短信内容 |
||||
|
* @param delayedTime 延迟发送时间(毫秒) |
||||
|
*/ |
||||
|
void delayMessageTexting(List<String> phones, String message, Long delayedTime); |
||||
|
|
||||
|
/** |
||||
|
* 延迟群发:使用自定义模板发送群体延迟短信 |
||||
|
* |
||||
|
* @param phones 目标手机号列表(1~1000) |
||||
|
* @param templateId 短信模板ID |
||||
|
* @param messages 短信模板参数,使用 LinkedHashMap 以保持参数顺序 |
||||
|
* @param delayedTime 延迟发送时间(毫秒) |
||||
|
*/ |
||||
|
void delayMessageTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages, Long delayedTime); |
||||
|
|
||||
|
/** |
||||
|
* 加入黑名单 |
||||
|
* |
||||
|
* @param phone 手机号 |
||||
|
*/ |
||||
|
void addBlacklist(String phone); |
||||
|
|
||||
|
/** |
||||
|
* 加入黑名单 |
||||
|
* |
||||
|
* @param phones 手机号列表 |
||||
|
*/ |
||||
|
void addBlacklist(List<String> phones); |
||||
|
|
||||
|
/** |
||||
|
* 移除黑名单 |
||||
|
* |
||||
|
* @param phone 手机号 |
||||
|
*/ |
||||
|
void removeBlacklist(String phone); |
||||
|
|
||||
|
/** |
||||
|
* 移除黑名单 |
||||
|
* |
||||
|
* @param phones 手机号 |
||||
|
*/ |
||||
|
void removeBlacklist(List<String> phones); |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package org.dromara.resource.api.domain; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 文件信息 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteFile implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* oss主键 |
||||
|
*/ |
||||
|
private Long ossId; |
||||
|
|
||||
|
/** |
||||
|
* 文件名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 文件地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 原名 |
||||
|
*/ |
||||
|
private String originalName; |
||||
|
|
||||
|
/** |
||||
|
* 文件后缀名 |
||||
|
*/ |
||||
|
private String fileSuffix; |
||||
|
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package org.dromara.resource.api.domain; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 文件信息 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteSms implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 是否成功 |
||||
|
*/ |
||||
|
private Boolean success; |
||||
|
|
||||
|
/** |
||||
|
* 配置标识名 如未配置取对应渠道名例如 Alibaba |
||||
|
*/ |
||||
|
private String configId; |
||||
|
|
||||
|
/** |
||||
|
* 厂商原返回体 |
||||
|
* <p> |
||||
|
* 可自行转换为 SDK 对应的 SendSmsResponse |
||||
|
*/ |
||||
|
private String response; |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk-api</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>ruoyi-api-system</artifactId> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-api-system系统接口模块 |
||||
|
</description> |
||||
|
|
||||
|
<dependencies> |
||||
|
|
||||
|
<!-- RuoYi Common Core--> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-core</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-excel</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,20 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.system.api.domain.vo.RemoteClientVo; |
||||
|
|
||||
|
/** |
||||
|
* 客户端服务 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
public interface RemoteClientService { |
||||
|
|
||||
|
/** |
||||
|
* 根据客户端id获取客户端详情 |
||||
|
* |
||||
|
* @param clientId 客户端id |
||||
|
* @return 客户端对象 |
||||
|
*/ |
||||
|
RemoteClientVo queryByClientId(String clientId); |
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
/** |
||||
|
* 配置服务 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
public interface RemoteConfigService { |
||||
|
|
||||
|
/** |
||||
|
* 获取注册开关 |
||||
|
* @param tenantId 租户id |
||||
|
* @return true开启,false关闭 |
||||
|
*/ |
||||
|
boolean selectRegisterEnabled(String tenantId); |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
/** |
||||
|
* 数据权限服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteDataScopeService { |
||||
|
|
||||
|
/** |
||||
|
* 获取角色自定义权限语句 |
||||
|
* |
||||
|
* @param roleId 角色ID |
||||
|
* @return 返回角色的自定义权限语句,如果没有找到则返回 null |
||||
|
*/ |
||||
|
String getRoleCustom(Long roleId); |
||||
|
|
||||
|
/** |
||||
|
* 获取部门和下级权限语句 |
||||
|
* |
||||
|
* @param deptId 部门ID |
||||
|
* @return 返回部门及其下级的权限语句,如果没有找到则返回 null |
||||
|
*/ |
||||
|
String getDeptAndChild(Long deptId); |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
/** |
||||
|
* 部门服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteDeptService { |
||||
|
|
||||
|
/** |
||||
|
* 通过部门ID查询部门名称 |
||||
|
* |
||||
|
* @param deptIds 部门ID串逗号分隔 |
||||
|
* @return 部门名称串逗号分隔 |
||||
|
*/ |
||||
|
String selectDeptNameByIds(String deptIds); |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.system.api.domain.vo.RemoteDictDataVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 字典服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteDictService { |
||||
|
|
||||
|
/** |
||||
|
* 根据字典类型查询字典数据 |
||||
|
* |
||||
|
* @param dictType 字典类型 |
||||
|
* @return 字典数据集合信息 |
||||
|
*/ |
||||
|
List<RemoteDictDataVo> selectDictDataByType(String dictType); |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.system.api.domain.bo.RemoteLogininforBo; |
||||
|
import org.dromara.system.api.domain.bo.RemoteOperLogBo; |
||||
|
|
||||
|
/** |
||||
|
* 日志服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteLogService { |
||||
|
|
||||
|
/** |
||||
|
* 保存系统日志 |
||||
|
* |
||||
|
* @param sysOperLog 日志实体 |
||||
|
*/ |
||||
|
void saveLog(RemoteOperLogBo sysOperLog); |
||||
|
|
||||
|
/** |
||||
|
* 保存访问记录 |
||||
|
* |
||||
|
* @param sysLogininfor 访问实体 |
||||
|
*/ |
||||
|
void saveLogininfor(RemoteLogininforBo sysLogininfor); |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.system.api.domain.bo.RemoteSocialBo; |
||||
|
import org.dromara.system.api.domain.vo.RemoteSocialVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 社会化关系服务 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
public interface RemoteSocialService { |
||||
|
|
||||
|
/** |
||||
|
* 根据 authId 查询用户授权信息 |
||||
|
* |
||||
|
* @param authId 认证id |
||||
|
* @return 授权信息 |
||||
|
*/ |
||||
|
List<RemoteSocialVo> selectByAuthId(String authId); |
||||
|
|
||||
|
/** |
||||
|
* 查询列表 |
||||
|
* |
||||
|
* @param bo 社会化关系业务对象 |
||||
|
*/ |
||||
|
List<RemoteSocialVo> queryList(RemoteSocialBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 保存社会化关系 |
||||
|
* |
||||
|
* @param bo 社会化关系业务对象 |
||||
|
*/ |
||||
|
void insertByBo(RemoteSocialBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 更新社会化关系 |
||||
|
* |
||||
|
* @param bo 社会化关系业务对象 |
||||
|
*/ |
||||
|
void updateByBo(RemoteSocialBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 删除社会化关系 |
||||
|
* |
||||
|
* @param socialId 社会化关系ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
Boolean deleteWithValidById(Long socialId); |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
|
||||
|
import org.dromara.system.api.domain.vo.RemoteTenantVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 租户服务 |
||||
|
* |
||||
|
* @author zhujie |
||||
|
*/ |
||||
|
public interface RemoteTenantService { |
||||
|
|
||||
|
/** |
||||
|
* 根据租户id获取租户详情 |
||||
|
* @param tenantId 租户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
RemoteTenantVo queryByTenantId(String tenantId); |
||||
|
|
||||
|
/** |
||||
|
* 获取租户列表 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
List<RemoteTenantVo> queryList(); |
||||
|
|
||||
|
} |
@ -0,0 +1,134 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.common.core.exception.user.UserException; |
||||
|
import org.dromara.system.api.domain.bo.RemoteUserBo; |
||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.dromara.system.api.model.XcxLoginUser; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 用户服务 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface RemoteUserService { |
||||
|
|
||||
|
/** |
||||
|
* 通过用户名查询用户信息 |
||||
|
* |
||||
|
* @param username 用户名 |
||||
|
* @param tenantId 租户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
LoginUser getUserInfo(String username, String tenantId) throws UserException; |
||||
|
|
||||
|
/** |
||||
|
* 通过用户id查询用户信息 |
||||
|
* |
||||
|
* @param userId 用户id |
||||
|
* @param tenantId 租户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
LoginUser getUserInfo(Long userId, String tenantId) throws UserException; |
||||
|
|
||||
|
/** |
||||
|
* 通过手机号查询用户信息 |
||||
|
* |
||||
|
* @param phonenumber 手机号 |
||||
|
* @param tenantId 租户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
LoginUser getUserInfoByPhonenumber(String phonenumber, String tenantId) throws UserException; |
||||
|
|
||||
|
/** |
||||
|
* 通过邮箱查询用户信息 |
||||
|
* |
||||
|
* @param email 邮箱 |
||||
|
* @param tenantId 租户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
LoginUser getUserInfoByEmail(String email, String tenantId) throws UserException; |
||||
|
|
||||
|
/** |
||||
|
* 通过openid查询用户信息 |
||||
|
* |
||||
|
* @param openid openid |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
XcxLoginUser getUserInfoByOpenid(String openid) throws UserException; |
||||
|
|
||||
|
/** |
||||
|
* 注册用户信息 |
||||
|
* |
||||
|
* @param remoteUserBo 用户信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
Boolean registerUserInfo(RemoteUserBo remoteUserBo) throws UserException, ServiceException; |
||||
|
|
||||
|
/** |
||||
|
* 通过userId查询用户账户 |
||||
|
* |
||||
|
* @param userId 用户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
String selectUserNameById(Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 通过用户ID查询用户昵称 |
||||
|
* |
||||
|
* @param userId 用户id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
String selectNicknameById(Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 通过用户ID查询用户账户 |
||||
|
* |
||||
|
* @param userIds 用户ID 多个用逗号隔开 |
||||
|
* @return 用户名称 |
||||
|
*/ |
||||
|
String selectNicknameByIds(String userIds); |
||||
|
|
||||
|
/** |
||||
|
* 通过用户ID查询用户手机号 |
||||
|
* |
||||
|
* @param userId 用户id |
||||
|
* @return 用户手机号 |
||||
|
*/ |
||||
|
String selectPhonenumberById(Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 通过用户ID查询用户邮箱 |
||||
|
* |
||||
|
* @param userId 用户id |
||||
|
* @return 用户邮箱 |
||||
|
*/ |
||||
|
String selectEmailById(Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 更新用户信息 |
||||
|
* |
||||
|
* @param userId 用户ID |
||||
|
* @param ip IP地址 |
||||
|
*/ |
||||
|
void recordLoginInfo(Long userId, String ip); |
||||
|
|
||||
|
/** |
||||
|
* 通过用户ID查询用户列表 |
||||
|
* |
||||
|
* @param userIds 用户ids |
||||
|
* @return 用户列表 |
||||
|
*/ |
||||
|
List<RemoteUserVo> selectListByIds(List<Long> userIds); |
||||
|
|
||||
|
/** |
||||
|
* 通过角色ID查询用户ID |
||||
|
* |
||||
|
* @param roleIds 角色ids |
||||
|
* @return 用户ids |
||||
|
*/ |
||||
|
List<Long> selectUserIdsByRoleIds(List<Long> roleIds); |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package org.dromara.system.api.domain; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 当前在线会话 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class SysUserOnline implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 会话编号 |
||||
|
*/ |
||||
|
private String tokenId; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 用户名称 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
|
||||
|
/** |
||||
|
* 客户端 |
||||
|
*/ |
||||
|
private String clientKey; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
*/ |
||||
|
private String deviceType; |
||||
|
|
||||
|
/** |
||||
|
* 登录IP地址 |
||||
|
*/ |
||||
|
private String ipaddr; |
||||
|
|
||||
|
/** |
||||
|
* 登录地址 |
||||
|
*/ |
||||
|
private String loginLocation; |
||||
|
|
||||
|
/** |
||||
|
* 浏览器类型 |
||||
|
*/ |
||||
|
private String browser; |
||||
|
|
||||
|
/** |
||||
|
* 操作系统 |
||||
|
*/ |
||||
|
private String os; |
||||
|
|
||||
|
/** |
||||
|
* 登录时间 |
||||
|
*/ |
||||
|
private Long loginTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
package org.dromara.system.api.domain.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 系统访问记录表 sys_logininfor |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RemoteLogininforBo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 访问ID |
||||
|
*/ |
||||
|
private Long infoId; |
||||
|
|
||||
|
/** |
||||
|
* 租户编号 |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 用户账号 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
|
||||
|
/** |
||||
|
* 客户端 |
||||
|
*/ |
||||
|
private String clientKey; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
*/ |
||||
|
private String deviceType; |
||||
|
|
||||
|
/** |
||||
|
* 登录IP地址 |
||||
|
*/ |
||||
|
private String ipaddr; |
||||
|
|
||||
|
/** |
||||
|
* 登录地点 |
||||
|
*/ |
||||
|
private String loginLocation; |
||||
|
|
||||
|
/** |
||||
|
* 浏览器类型 |
||||
|
*/ |
||||
|
private String browser; |
||||
|
|
||||
|
/** |
||||
|
* 操作系统 |
||||
|
*/ |
||||
|
private String os; |
||||
|
|
||||
|
/** |
||||
|
* 登录状态(0成功 1失败) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 提示消息 |
||||
|
*/ |
||||
|
private String msg; |
||||
|
|
||||
|
/** |
||||
|
* 访问时间 |
||||
|
*/ |
||||
|
private Date loginTime; |
||||
|
|
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
private Map<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
} |
@ -0,0 +1,119 @@ |
|||||
|
package org.dromara.system.api.domain.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 操作日志记录表 oper_log |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RemoteOperLogBo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 日志主键 |
||||
|
*/ |
||||
|
private Long operId; |
||||
|
|
||||
|
/** |
||||
|
* 租户编号 |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 模块标题 |
||||
|
*/ |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 业务类型(0其它 1新增 2修改 3删除) |
||||
|
*/ |
||||
|
private Integer businessType; |
||||
|
|
||||
|
/** |
||||
|
* 方法名称 |
||||
|
*/ |
||||
|
private String method; |
||||
|
|
||||
|
/** |
||||
|
* 请求方式 |
||||
|
*/ |
||||
|
private String requestMethod; |
||||
|
|
||||
|
/** |
||||
|
* 操作类别(0其它 1后台用户 2手机端用户) |
||||
|
*/ |
||||
|
private Integer operatorType; |
||||
|
|
||||
|
/** |
||||
|
* 操作人员 |
||||
|
*/ |
||||
|
private String operName; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 请求URL |
||||
|
*/ |
||||
|
private String operUrl; |
||||
|
|
||||
|
/** |
||||
|
* 主机地址 |
||||
|
*/ |
||||
|
private String operIp; |
||||
|
|
||||
|
/** |
||||
|
* 操作地点 |
||||
|
*/ |
||||
|
private String operLocation; |
||||
|
|
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
private String operParam; |
||||
|
|
||||
|
/** |
||||
|
* 返回参数 |
||||
|
*/ |
||||
|
private String jsonResult; |
||||
|
|
||||
|
/** |
||||
|
* 操作状态(0正常 1异常) |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
* 错误消息 |
||||
|
*/ |
||||
|
private String errorMsg; |
||||
|
|
||||
|
/** |
||||
|
* 操作时间 |
||||
|
*/ |
||||
|
private Date operTime; |
||||
|
|
||||
|
/** |
||||
|
* 消耗时间 |
||||
|
*/ |
||||
|
private Long costTime; |
||||
|
|
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
private Map<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
} |
@ -0,0 +1,129 @@ |
|||||
|
package org.dromara.system.api.domain.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 社会化关系业务对象 sys_social |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RemoteSocialBo implements Serializable { |
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 的唯一ID |
||||
|
*/ |
||||
|
private String authId; |
||||
|
|
||||
|
/** |
||||
|
* 用户来源 |
||||
|
*/ |
||||
|
private String source; |
||||
|
|
||||
|
/** |
||||
|
* 用户的授权令牌 |
||||
|
*/ |
||||
|
private String accessToken; |
||||
|
|
||||
|
/** |
||||
|
* 用户的授权令牌的有效期,部分平台可能没有 |
||||
|
*/ |
||||
|
private int expireIn; |
||||
|
|
||||
|
/** |
||||
|
* 刷新令牌,部分平台可能没有 |
||||
|
*/ |
||||
|
private String refreshToken; |
||||
|
|
||||
|
/** |
||||
|
* 平台唯一id |
||||
|
*/ |
||||
|
private String openId; |
||||
|
|
||||
|
/** |
||||
|
* 用户的 ID |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 平台的授权信息,部分平台可能没有 |
||||
|
*/ |
||||
|
private String accessCode; |
||||
|
|
||||
|
/** |
||||
|
* 用户的 unionid |
||||
|
*/ |
||||
|
private String unionId; |
||||
|
|
||||
|
/** |
||||
|
* 授予的权限,部分平台可能没有 |
||||
|
*/ |
||||
|
private String scope; |
||||
|
|
||||
|
/** |
||||
|
* 授权的第三方账号 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
|
||||
|
/** |
||||
|
* 授权的第三方昵称 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 授权的第三方邮箱 |
||||
|
*/ |
||||
|
private String email; |
||||
|
|
||||
|
/** |
||||
|
* 授权的第三方头像地址 |
||||
|
*/ |
||||
|
private String avatar; |
||||
|
|
||||
|
/** |
||||
|
* 个别平台的授权信息,部分平台可能没有 |
||||
|
*/ |
||||
|
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,124 @@ |
|||||
|
package org.dromara.system.api.domain.bo; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.dromara.common.core.constant.UserConstants; |
||||
|
import org.dromara.common.core.xss.Xss; |
||||
|
|
||||
|
import jakarta.validation.constraints.Email; |
||||
|
import jakarta.validation.constraints.NotBlank; |
||||
|
import jakarta.validation.constraints.Size; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 用户信息业务对象 sys_user |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RemoteUserBo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 租户ID |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 部门ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 用户账号 |
||||
|
*/ |
||||
|
@Xss(message = "用户账号不能包含脚本字符") |
||||
|
@NotBlank(message = "用户账号不能为空") |
||||
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过{max}个字符") |
||||
|
private String userName; |
||||
|
|
||||
|
/** |
||||
|
* 用户昵称 |
||||
|
*/ |
||||
|
@Xss(message = "用户昵称不能包含脚本字符") |
||||
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过{max}个字符") |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 用户类型(sys_user系统用户) |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 用户邮箱 |
||||
|
*/ |
||||
|
@Email(message = "邮箱格式不正确") |
||||
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") |
||||
|
private String email; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 用户性别(0男 1女 2未知) |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 头像地址 |
||||
|
*/ |
||||
|
private Long avatar; |
||||
|
|
||||
|
/** |
||||
|
* 密码 |
||||
|
*/ |
||||
|
private String password; |
||||
|
|
||||
|
/** |
||||
|
* 帐号状态(0正常 1停用) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 最后登录IP |
||||
|
*/ |
||||
|
private String loginIp; |
||||
|
|
||||
|
/** |
||||
|
* 最后登录时间 |
||||
|
*/ |
||||
|
private Date loginDate; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 数据权限 当前角色ID |
||||
|
*/ |
||||
|
private Long roleId; |
||||
|
|
||||
|
public RemoteUserBo(Long userId) { |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
public boolean isSuperAdmin() { |
||||
|
return UserConstants.SUPER_ADMIN_ID.equals(this.userId); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
package org.dromara.system.api.domain.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 授权管理视图对象 sys_client |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteClientVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 客户端id |
||||
|
*/ |
||||
|
private String clientId; |
||||
|
|
||||
|
/** |
||||
|
* 客户端key |
||||
|
*/ |
||||
|
private String clientKey; |
||||
|
|
||||
|
/** |
||||
|
* 客户端秘钥 |
||||
|
*/ |
||||
|
private String clientSecret; |
||||
|
|
||||
|
/** |
||||
|
* 授权类型 |
||||
|
*/ |
||||
|
private List<String> grantTypeList; |
||||
|
|
||||
|
/** |
||||
|
* 授权类型 |
||||
|
*/ |
||||
|
private String grantType; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
*/ |
||||
|
private String deviceType; |
||||
|
|
||||
|
/** |
||||
|
* token活跃超时时间 |
||||
|
*/ |
||||
|
private Long activeTimeout; |
||||
|
|
||||
|
/** |
||||
|
* token固定超时时间 |
||||
|
*/ |
||||
|
private Long timeout; |
||||
|
|
||||
|
/** |
||||
|
* 状态(0正常 1停用) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
package org.dromara.system.api.domain.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 字典数据视图对象 sys_dict_data |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteDictDataVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
private Long dictCode; |
||||
|
|
||||
|
/** |
||||
|
* 字典排序 |
||||
|
*/ |
||||
|
private Integer dictSort; |
||||
|
|
||||
|
/** |
||||
|
* 字典标签 |
||||
|
*/ |
||||
|
private String dictLabel; |
||||
|
|
||||
|
/** |
||||
|
* 字典键值 |
||||
|
*/ |
||||
|
private String dictValue; |
||||
|
|
||||
|
/** |
||||
|
* 字典类型 |
||||
|
*/ |
||||
|
private String dictType; |
||||
|
|
||||
|
/** |
||||
|
* 样式属性(其他样式扩展) |
||||
|
*/ |
||||
|
private String cssClass; |
||||
|
|
||||
|
/** |
||||
|
* 表格回显样式 |
||||
|
*/ |
||||
|
private String listClass; |
||||
|
|
||||
|
/** |
||||
|
* 是否默认(Y是 N否) |
||||
|
*/ |
||||
|
private String isDefault; |
||||
|
|
||||
|
/** |
||||
|
* 状态(0正常 1停用) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,135 @@ |
|||||
|
package org.dromara.system.api.domain.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 社会化关系视图对象 sys_social |
||||
|
* |
||||
|
* @author thiszhc |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteSocialVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 租户ID |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 认证唯一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,91 @@ |
|||||
|
package org.dromara.system.api.domain.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 租户视图对象 |
||||
|
* |
||||
|
* @author zhujie |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RemoteTenantVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 租户编号 |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 联系人 |
||||
|
*/ |
||||
|
private String contactUserName; |
||||
|
|
||||
|
/** |
||||
|
* 联系电话 |
||||
|
*/ |
||||
|
private String contactPhone; |
||||
|
|
||||
|
/** |
||||
|
* 企业名称 |
||||
|
*/ |
||||
|
private String companyName; |
||||
|
|
||||
|
/** |
||||
|
* 统一社会信用代码 |
||||
|
*/ |
||||
|
private String licenseNumber; |
||||
|
|
||||
|
/** |
||||
|
* 地址 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
/** |
||||
|
* 域名 |
||||
|
*/ |
||||
|
private String domain; |
||||
|
|
||||
|
/** |
||||
|
* 企业简介 |
||||
|
*/ |
||||
|
private String intro; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 租户套餐编号 |
||||
|
*/ |
||||
|
private Long packageId; |
||||
|
|
||||
|
/** |
||||
|
* 过期时间 |
||||
|
*/ |
||||
|
private Date expireTime; |
||||
|
|
||||
|
/** |
||||
|
* 用户数量(-1不限制) |
||||
|
*/ |
||||
|
private Long accountCount; |
||||
|
|
||||
|
/** |
||||
|
* 租户状态(0正常 1停用) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package org.dromara.system.api.domain.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RemoteUserVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 部门ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 用户账号 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
|
||||
|
/** |
||||
|
* 用户昵称 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 用户类型(sys_user系统用户) |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 用户邮箱 |
||||
|
*/ |
||||
|
private String email; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 用户性别(0男 1女 2未知) |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 帐号状态(0正常 1停用) |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,146 @@ |
|||||
|
package org.dromara.system.api.model; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* 用户信息 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class LoginUser implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 租户ID |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 部门ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 部门类别编码 |
||||
|
*/ |
||||
|
private String deptCategory; |
||||
|
|
||||
|
/** |
||||
|
* 部门名 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 用户唯一标识 |
||||
|
*/ |
||||
|
private String token; |
||||
|
|
||||
|
/** |
||||
|
* 用户类型 |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 登录时间 |
||||
|
*/ |
||||
|
private Long loginTime; |
||||
|
|
||||
|
/** |
||||
|
* 过期时间 |
||||
|
*/ |
||||
|
private Long expireTime; |
||||
|
|
||||
|
/** |
||||
|
* 登录IP地址 |
||||
|
*/ |
||||
|
private String ipaddr; |
||||
|
|
||||
|
/** |
||||
|
* 登录地点 |
||||
|
*/ |
||||
|
private String loginLocation; |
||||
|
|
||||
|
/** |
||||
|
* 浏览器类型 |
||||
|
*/ |
||||
|
private String browser; |
||||
|
|
||||
|
/** |
||||
|
* 操作系统 |
||||
|
*/ |
||||
|
private String os; |
||||
|
|
||||
|
/** |
||||
|
* 菜单权限 |
||||
|
*/ |
||||
|
private Set<String> menuPermission; |
||||
|
|
||||
|
/** |
||||
|
* 角色权限 |
||||
|
*/ |
||||
|
private Set<String> rolePermission; |
||||
|
|
||||
|
/** |
||||
|
* 用户名 |
||||
|
*/ |
||||
|
private String username; |
||||
|
|
||||
|
/** |
||||
|
* 用户昵称 |
||||
|
*/ |
||||
|
private String nickname; |
||||
|
|
||||
|
/** |
||||
|
* 密码 |
||||
|
*/ |
||||
|
private String password; |
||||
|
|
||||
|
/** |
||||
|
* 角色对象 |
||||
|
*/ |
||||
|
private List<RoleDTO> roles; |
||||
|
|
||||
|
/** |
||||
|
* 数据权限 当前角色ID |
||||
|
*/ |
||||
|
private Long roleId; |
||||
|
|
||||
|
/** |
||||
|
* 客户端 |
||||
|
*/ |
||||
|
private String clientKey; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
*/ |
||||
|
private String deviceType; |
||||
|
|
||||
|
/** |
||||
|
* 获取登录id |
||||
|
*/ |
||||
|
public String getLoginId() { |
||||
|
if (userType == null) { |
||||
|
throw new IllegalArgumentException("用户类型不能为空"); |
||||
|
} |
||||
|
if (userId == null) { |
||||
|
throw new IllegalArgumentException("用户ID不能为空"); |
||||
|
} |
||||
|
return userType + ":" + userId; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package org.dromara.system.api.model; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 角色 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class RoleDTO implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private Long roleId; |
||||
|
|
||||
|
/** |
||||
|
* 角色名称 |
||||
|
*/ |
||||
|
private String roleName; |
||||
|
|
||||
|
/** |
||||
|
* 角色权限 |
||||
|
*/ |
||||
|
private String roleKey; |
||||
|
|
||||
|
/** |
||||
|
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
||||
|
*/ |
||||
|
private String dataScope; |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package org.dromara.system.api.model; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 小程序登录用户身份权限 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@NoArgsConstructor |
||||
|
public class XcxLoginUser extends LoginUser { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* openid |
||||
|
*/ |
||||
|
private String openid; |
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk-api</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>api-workflow</artifactId> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-api-workflow 工作流接口模块 |
||||
|
</description> |
||||
|
|
||||
|
<dependencies> |
||||
|
|
||||
|
<!-- RuoYi Common Core--> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-core</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-bus</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,78 @@ |
|||||
|
package org.dromara.workflow.api.domain; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 通用 工作流服务 |
||||
|
* |
||||
|
* @Author ZETA |
||||
|
* @Date 2024/6/3 |
||||
|
*/ |
||||
|
public interface RemoteWorkflowService { |
||||
|
|
||||
|
/** |
||||
|
* 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息 |
||||
|
* |
||||
|
* @param businessKeys 业务id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
boolean deleteRunAndHisInstance(List<String> businessKeys); |
||||
|
|
||||
|
/** |
||||
|
* 获取当前流程状态 |
||||
|
* |
||||
|
* @param taskId 任务id |
||||
|
*/ |
||||
|
String getBusinessStatusByTaskId(String taskId); |
||||
|
|
||||
|
/** |
||||
|
* 获取当前流程状态 |
||||
|
* |
||||
|
* @param businessKey 业务id |
||||
|
*/ |
||||
|
String getBusinessStatus(String businessKey); |
||||
|
|
||||
|
/** |
||||
|
* 设置流程变量(全局变量) |
||||
|
* |
||||
|
* @param taskId 任务id |
||||
|
* @param variableName 变量名称 |
||||
|
* @param value 变量值 |
||||
|
*/ |
||||
|
void setVariable(String taskId, String variableName, Object value); |
||||
|
|
||||
|
/** |
||||
|
* 设置流程变量(全局变量) |
||||
|
* |
||||
|
* @param taskId 任务id |
||||
|
* @param variables 流程变量 |
||||
|
*/ |
||||
|
void setVariables(String taskId, Map<String, Object> variables); |
||||
|
|
||||
|
/** |
||||
|
* 设置流程变量(本地变量,非全局变量) |
||||
|
* |
||||
|
* @param taskId 任务id |
||||
|
* @param variableName 变量名称 |
||||
|
* @param value 变量值 |
||||
|
*/ |
||||
|
void setVariableLocal(String taskId, String variableName, Object value); |
||||
|
|
||||
|
/** |
||||
|
* 设置流程变量(本地变量,非全局变量) |
||||
|
* |
||||
|
* @param taskId 任务id |
||||
|
* @param variables 流程变量 |
||||
|
*/ |
||||
|
void setVariablesLocal(String taskId, Map<String, Object> variables); |
||||
|
|
||||
|
/** |
||||
|
* 按照业务id查询流程实例id |
||||
|
* |
||||
|
* @param businessKey 业务id |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
String getInstanceIdByBusinessKey(String businessKey); |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package org.dromara.workflow.api.domain.event; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.dromara.common.core.utils.SpringUtils; |
||||
|
import org.springframework.cloud.bus.event.RemoteApplicationEvent; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 总体流程监听 |
||||
|
* |
||||
|
* @author may |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
public class ProcessEvent extends RemoteApplicationEvent { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 流程定义key |
||||
|
*/ |
||||
|
private String key; |
||||
|
|
||||
|
/** |
||||
|
* 业务id |
||||
|
*/ |
||||
|
private String businessKey; |
||||
|
|
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 当为true时为申请人节点办理 |
||||
|
*/ |
||||
|
private boolean submit; |
||||
|
|
||||
|
public ProcessEvent() { |
||||
|
super(new Object(), SpringUtils.getApplicationName(), DEFAULT_DESTINATION_FACTORY.getDestination(null)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package org.dromara.workflow.api.domain.event; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.dromara.common.core.utils.SpringUtils; |
||||
|
import org.springframework.cloud.bus.event.RemoteApplicationEvent; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 流程办理监听 |
||||
|
* |
||||
|
* @author may |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
public class ProcessTaskEvent extends RemoteApplicationEvent { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 流程定义key |
||||
|
*/ |
||||
|
private String key; |
||||
|
|
||||
|
/** |
||||
|
* 审批节点key |
||||
|
*/ |
||||
|
private String taskDefinitionKey; |
||||
|
|
||||
|
/** |
||||
|
* 任务id |
||||
|
*/ |
||||
|
private String taskId; |
||||
|
|
||||
|
/** |
||||
|
* 业务id |
||||
|
*/ |
||||
|
private String businessKey; |
||||
|
|
||||
|
public ProcessTaskEvent() { |
||||
|
super(new Object(), SpringUtils.getApplicationName(), DEFAULT_DESTINATION_FACTORY.getDestination(null)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk_cloud_drone</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<modules> |
||||
|
<module>api-bom</module> |
||||
|
<module>api-system</module> |
||||
|
<module>api-resource</module> |
||||
|
<module>api-workflow</module> |
||||
|
</modules> |
||||
|
|
||||
|
<artifactId>dk-api</artifactId> |
||||
|
<packaging>pom</packaging> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-api系统接口 |
||||
|
</description> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,182 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-alibaba-bom</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
<packaging>pom</packaging> |
||||
|
|
||||
|
<description> |
||||
|
common-alibaba-bom alibaba依赖项 |
||||
|
</description> |
||||
|
|
||||
|
<properties> |
||||
|
<revision>2.2.2</revision> |
||||
|
<spring-cloud-alibaba.version>2023.0.1.2</spring-cloud-alibaba.version> |
||||
|
<sentinel.version>1.8.8</sentinel.version> |
||||
|
<seata.version>1.7.1</seata.version> |
||||
|
<nacos.client.version>2.3.3</nacos.client.version> |
||||
|
<dubbo.version>3.2.14</dubbo.version> |
||||
|
<spring.context.support.version>1.0.11</spring.context.support.version> |
||||
|
</properties> |
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId> |
||||
|
<version>${spring-cloud-alibaba.version}</version> |
||||
|
<type>pom</type> |
||||
|
<scope>import</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.nacos</groupId> |
||||
|
<artifactId>nacos-client</artifactId> |
||||
|
<version>${nacos.client.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-core</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-parameter-flow-control</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-extension</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-apollo</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-zookeeper</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-nacos</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-redis</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-datasource-consul</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-web-servlet</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-spring-cloud-gateway-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-transport-simple-http</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-annotation-aspectj</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-reactor-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-cluster-server-default</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-cluster-client-default</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-spring-webflux-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-api-gateway-adapter-common</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-spring-webmvc-v6x-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-dubbo-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-apache-dubbo-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.csp</groupId> |
||||
|
<artifactId>sentinel-apache-dubbo3-adapter</artifactId> |
||||
|
<version>${sentinel.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>io.seata</groupId> |
||||
|
<artifactId>seata-spring-boot-starter</artifactId> |
||||
|
<version>${seata.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- Apache Dubbo 配置 --> |
||||
|
<dependency> |
||||
|
<groupId>org.apache.dubbo</groupId> |
||||
|
<artifactId>dubbo-spring-boot-starter</artifactId> |
||||
|
<version>${dubbo.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.apache.dubbo</groupId> |
||||
|
<artifactId>dubbo-spring-boot-actuator</artifactId> |
||||
|
<version>${dubbo.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.apache.dubbo</groupId> |
||||
|
<artifactId>dubbo</artifactId> |
||||
|
<version>${dubbo.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.apache.dubbo</groupId> |
||||
|
<artifactId>dubbo-metadata-report-redis</artifactId> |
||||
|
<version>${dubbo.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.spring</groupId> |
||||
|
<artifactId>spring-context-support</artifactId> |
||||
|
<version>${spring.context.support.version}</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
</project> |
@ -0,0 +1,262 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-bom</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
<packaging>pom</packaging> |
||||
|
|
||||
|
<description> |
||||
|
common-bom common依赖项 |
||||
|
</description> |
||||
|
|
||||
|
<properties> |
||||
|
<revision>2.2.2</revision> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<!-- 核心模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-core</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 接口模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-doc</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 安全模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-security</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 权限认证服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-satoken</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 日志记录 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-log</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 字典 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-dict</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- excel --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-excel</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 缓存服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-redis</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- web服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-web</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 数据库服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-mybatis</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 定时任务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-job</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- RPC服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-dubbo</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 分布式事务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-seata</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 自定义负载均衡 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-loadbalancer</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- oss服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-oss</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 限流功能 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-ratelimiter</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 幂等功能 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-idempotent</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 邮件模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-mail</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 短信模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-sms</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- logstash日志推送模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-logstash</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- ES搜索引擎服务 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-elasticsearch</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 限流模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-sentinel</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- skywalking日志收集模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-skylog</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- prometheus监控 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-prometheus</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 通用翻译功能 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-translation</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 脱敏模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-sensitive</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 序列化模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-json</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 数据加解密模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-encrypt</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 租户模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-tenant</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- websocket模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-websocket</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 授权认证 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-social</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 配置中心 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-nacos</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 消息总线模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-bus</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- sse --> |
||||
|
<dependency> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>common-sse</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
</project> |
@ -0,0 +1,35 @@ |
|||||
|
<?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> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk-common</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>common-bus</artifactId> |
||||
|
|
||||
|
<description> |
||||
|
common-bus 消息总线模块 |
||||
|
</description> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!-- rabbitmq --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-bus-amqp</artifactId> |
||||
|
</dependency> |
||||
|
<!-- kafka --> |
||||
|
<!-- <dependency>--> |
||||
|
<!-- <groupId>org.springframework.cloud</groupId>--> |
||||
|
<!-- <artifactId>spring-cloud-starter-bus-kafka</artifactId>--> |
||||
|
<!-- </dependency>--> |
||||
|
<!-- rocketmq --> |
||||
|
<!-- <dependency>--> |
||||
|
<!-- <groupId>com.alibaba.cloud</groupId>--> |
||||
|
<!-- <artifactId>spring-cloud-starter-bus-rocketmq</artifactId>--> |
||||
|
<!-- </dependency>--> |
||||
|
</dependencies> |
||||
|
</project> |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.common.bus.config; |
||||
|
|
||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration; |
||||
|
import org.springframework.cloud.bus.jackson.RemoteApplicationEventScan; |
||||
|
|
||||
|
/** |
||||
|
* bus 配置 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@AutoConfiguration |
||||
|
@RemoteApplicationEventScan(basePackages = "${spring.cloud.bus.base-packages}") |
||||
|
public class BusCustomConfiguration { |
||||
|
|
||||
|
} |
@ -0,0 +1 @@ |
|||||
|
org.dromara.common.bus.config.BusCustomConfiguration |
@ -0,0 +1,104 @@ |
|||||
|
<?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> |
||||
|
<groupId>org.dromara</groupId> |
||||
|
<artifactId>dk-common</artifactId> |
||||
|
<version>${revision}</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>common-core</artifactId> |
||||
|
|
||||
|
<description> |
||||
|
ruoyi-common-core 核心模块 |
||||
|
</description> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!-- Spring框架基本的核心工具 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework</groupId> |
||||
|
<artifactId>spring-context-support</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- SpringWeb模块 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework</groupId> |
||||
|
<artifactId>spring-web</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- Hibernate Validator --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-validation</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-aop</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!--常用工具类 --> |
||||
|
<dependency> |
||||
|
<groupId>org.apache.commons</groupId> |
||||
|
<artifactId>commons-lang3</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- servlet包 --> |
||||
|
<dependency> |
||||
|
<groupId>jakarta.servlet</groupId> |
||||
|
<artifactId>jakarta.servlet-api</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>io.swagger.core.v3</groupId> |
||||
|
<artifactId>swagger-annotations</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-core</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-http</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-extra</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 自动生成YML配置关联JSON文件 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-configuration-processor</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-properties-migrator</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>io.github.linpeilie</groupId> |
||||
|
<artifactId>mapstruct-plus-spring-boot-starter</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 离线IP地址定位库 --> |
||||
|
<dependency> |
||||
|
<groupId>org.lionsoul</groupId> |
||||
|
<artifactId>ip2region</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,17 @@ |
|||||
|
package org.dromara.common.core.config; |
||||
|
|
||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration; |
||||
|
import org.springframework.context.annotation.EnableAspectJAutoProxy; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
|
||||
|
/** |
||||
|
* 程序注解配置 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@AutoConfiguration |
||||
|
@EnableAspectJAutoProxy |
||||
|
@EnableAsync(proxyTargetClass = true) |
||||
|
public class ApplicationConfig { |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package org.dromara.common.core.config; |
||||
|
|
||||
|
import cn.hutool.core.util.ArrayUtil; |
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.common.core.utils.SpringUtils; |
||||
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; |
||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration; |
||||
|
import org.springframework.core.task.VirtualThreadTaskExecutor; |
||||
|
import org.springframework.scheduling.annotation.AsyncConfigurer; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.concurrent.Executor; |
||||
|
|
||||
|
/** |
||||
|
* 异步配置 |
||||
|
* <p> |
||||
|
* 如果未使用虚拟线程则生效 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@AutoConfiguration |
||||
|
public class AsyncConfig implements AsyncConfigurer { |
||||
|
|
||||
|
/** |
||||
|
* 自定义 @Async 注解使用系统线程池 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Executor getAsyncExecutor() { |
||||
|
if(SpringUtils.isVirtual()) { |
||||
|
return new VirtualThreadTaskExecutor("async-"); |
||||
|
} |
||||
|
return SpringUtils.getBean("scheduledExecutorService"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 异步执行异常处理 |
||||
|
*/ |
||||
|
@Override |
||||
|
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { |
||||
|
return (throwable, method, objects) -> { |
||||
|
throwable.printStackTrace(); |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append("Exception message - ").append(throwable.getMessage()) |
||||
|
.append(", Method name - ").append(method.getName()); |
||||
|
if (ArrayUtil.isNotEmpty(objects)) { |
||||
|
sb.append(", Parameter value - ").append(Arrays.toString(objects)); |
||||
|
} |
||||
|
throw new ServiceException(sb.toString()); |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package org.dromara.common.core.config; |
||||
|
|
||||
|
import jakarta.annotation.PreDestroy; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.concurrent.BasicThreadFactory; |
||||
|
import org.dromara.common.core.utils.Threads; |
||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
|
||||
|
import java.util.concurrent.ScheduledExecutorService; |
||||
|
import java.util.concurrent.ScheduledThreadPoolExecutor; |
||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||
|
|
||||
|
/** |
||||
|
* 线程池配置 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@AutoConfiguration |
||||
|
public class ThreadPoolConfig { |
||||
|
|
||||
|
/** |
||||
|
* 核心线程数 = cpu 核心数 + 1 |
||||
|
*/ |
||||
|
private final int core = Runtime.getRuntime().availableProcessors() + 1; |
||||
|
|
||||
|
private ScheduledExecutorService scheduledExecutorService; |
||||
|
|
||||
|
/** |
||||
|
* 执行周期性或定时任务 |
||||
|
*/ |
||||
|
@Bean(name = "scheduledExecutorService") |
||||
|
protected ScheduledExecutorService scheduledExecutorService() { |
||||
|
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(core, |
||||
|
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), |
||||
|
new ThreadPoolExecutor.CallerRunsPolicy()) { |
||||
|
@Override |
||||
|
protected void afterExecute(Runnable r, Throwable t) { |
||||
|
super.afterExecute(r, t); |
||||
|
Threads.printException(r, t); |
||||
|
} |
||||
|
}; |
||||
|
this.scheduledExecutorService = scheduledThreadPoolExecutor; |
||||
|
return scheduledThreadPoolExecutor; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 销毁事件 |
||||
|
*/ |
||||
|
@PreDestroy |
||||
|
public void destroy() { |
||||
|
try { |
||||
|
log.info("====关闭后台任务任务线程池===="); |
||||
|
Threads.shutdownAndAwaitTermination(scheduledExecutorService); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package org.dromara.common.core.config; |
||||
|
|
||||
|
import jakarta.validation.Validator; |
||||
|
import org.hibernate.validator.HibernateValidator; |
||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration; |
||||
|
import org.springframework.context.MessageSource; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; |
||||
|
|
||||
|
import java.util.Properties; |
||||
|
|
||||
|
/** |
||||
|
* 校验框架配置类 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@AutoConfiguration |
||||
|
public class ValidatorConfig { |
||||
|
|
||||
|
/** |
||||
|
* 配置校验框架 快速返回模式 |
||||
|
*/ |
||||
|
@Bean |
||||
|
public Validator validator(MessageSource messageSource) { |
||||
|
try (LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean()) { |
||||
|
// 国际化
|
||||
|
factoryBean.setValidationMessageSource(messageSource); |
||||
|
// 设置使用 HibernateValidator 校验器
|
||||
|
factoryBean.setProviderClass(HibernateValidator.class); |
||||
|
Properties properties = new Properties(); |
||||
|
// 设置 快速异常返回
|
||||
|
properties.setProperty("hibernate.validator.fail_fast", "true"); |
||||
|
factoryBean.setValidationProperties(properties); |
||||
|
// 加载配置
|
||||
|
factoryBean.afterPropertiesSet(); |
||||
|
return factoryBean.getValidator(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 缓存的key 常量 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface CacheConstants { |
||||
|
|
||||
|
/** |
||||
|
* 在线用户 redis key |
||||
|
*/ |
||||
|
String ONLINE_TOKEN_KEY = "online_tokens:"; |
||||
|
|
||||
|
/** |
||||
|
* 参数管理 cache key |
||||
|
*/ |
||||
|
String SYS_CONFIG_KEY = "sys_config:"; |
||||
|
|
||||
|
/** |
||||
|
* 字典管理 cache key |
||||
|
*/ |
||||
|
String SYS_DICT_KEY = "sys_dict:"; |
||||
|
|
||||
|
/** |
||||
|
* 登录账户密码错误次数 redis key |
||||
|
*/ |
||||
|
String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; |
||||
|
|
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 缓存组名称常量 |
||||
|
* <p> |
||||
|
* key 格式为 cacheNames#ttl#maxIdleTime#maxSize |
||||
|
* <p> |
||||
|
* ttl 过期时间 如果设置为0则不过期 默认为0 |
||||
|
* maxIdleTime 最大空闲时间 根据LRU算法清理空闲数据 如果设置为0则不检测 默认为0 |
||||
|
* maxSize 组最大长度 根据LRU算法清理溢出数据 如果设置为0则无限长 默认为0 |
||||
|
* <p> |
||||
|
* 例子: test#60s、test#0#60s、test#0#1m#1000、test#1h#0#500 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface CacheNames { |
||||
|
|
||||
|
/** |
||||
|
* 演示案例 |
||||
|
*/ |
||||
|
String DEMO_CACHE = "demo:cache#60s#10m#20"; |
||||
|
|
||||
|
/** |
||||
|
* 系统配置 |
||||
|
*/ |
||||
|
String SYS_CONFIG = "sys_config"; |
||||
|
|
||||
|
/** |
||||
|
* 数据字典 |
||||
|
*/ |
||||
|
String SYS_DICT = "sys_dict"; |
||||
|
|
||||
|
/** |
||||
|
* 租户 |
||||
|
*/ |
||||
|
String SYS_TENANT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant#30d"; |
||||
|
|
||||
|
/** |
||||
|
* 客户端 |
||||
|
*/ |
||||
|
String SYS_CLIENT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_client#30d"; |
||||
|
|
||||
|
/** |
||||
|
* 用户账户 |
||||
|
*/ |
||||
|
String SYS_USER_NAME = "sys_user_name#30d"; |
||||
|
|
||||
|
/** |
||||
|
* 用户名称 |
||||
|
*/ |
||||
|
String SYS_NICKNAME = "sys_nickname#30d"; |
||||
|
|
||||
|
/** |
||||
|
* 部门 |
||||
|
*/ |
||||
|
String SYS_DEPT = "sys_dept#30d"; |
||||
|
|
||||
|
/** |
||||
|
* OSS内容 |
||||
|
*/ |
||||
|
String SYS_OSS = "sys_oss#30d"; |
||||
|
|
||||
|
/** |
||||
|
* OSS配置 |
||||
|
*/ |
||||
|
String SYS_OSS_CONFIG = GlobalConstants.GLOBAL_REDIS_KEY + "sys_oss_config"; |
||||
|
|
||||
|
/** |
||||
|
* 在线用户 |
||||
|
*/ |
||||
|
String ONLINE_TOKEN = "online_tokens"; |
||||
|
|
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 通用常量信息 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
public interface Constants { |
||||
|
|
||||
|
/** |
||||
|
* UTF-8 字符集 |
||||
|
*/ |
||||
|
String UTF8 = "UTF-8"; |
||||
|
|
||||
|
/** |
||||
|
* GBK 字符集 |
||||
|
*/ |
||||
|
String GBK = "GBK"; |
||||
|
|
||||
|
/** |
||||
|
* www主域 |
||||
|
*/ |
||||
|
String WWW = "www."; |
||||
|
|
||||
|
/** |
||||
|
* http请求 |
||||
|
*/ |
||||
|
String HTTP = "http://"; |
||||
|
|
||||
|
/** |
||||
|
* https请求 |
||||
|
*/ |
||||
|
String HTTPS = "https://"; |
||||
|
|
||||
|
/** |
||||
|
* 通用成功标识 |
||||
|
*/ |
||||
|
String SUCCESS = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 通用失败标识 |
||||
|
*/ |
||||
|
String FAIL = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 登录成功 |
||||
|
*/ |
||||
|
String LOGIN_SUCCESS = "Success"; |
||||
|
|
||||
|
/** |
||||
|
* 注销 |
||||
|
*/ |
||||
|
String LOGOUT = "Logout"; |
||||
|
|
||||
|
/** |
||||
|
* 注册 |
||||
|
*/ |
||||
|
String REGISTER = "Register"; |
||||
|
|
||||
|
/** |
||||
|
* 登录失败 |
||||
|
*/ |
||||
|
String LOGIN_FAIL = "Error"; |
||||
|
|
||||
|
/** |
||||
|
* 验证码有效期(分钟) |
||||
|
*/ |
||||
|
Integer CAPTCHA_EXPIRATION = 2; |
||||
|
|
||||
|
/** |
||||
|
* 令牌 |
||||
|
*/ |
||||
|
String TOKEN = "token"; |
||||
|
|
||||
|
/** |
||||
|
* 顶级部门id |
||||
|
*/ |
||||
|
Long TOP_PARENT_ID = 0L; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,35 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 全局的key常量 (业务无关的key) |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface GlobalConstants { |
||||
|
|
||||
|
/** |
||||
|
* 全局 redis key (业务无关的key) |
||||
|
*/ |
||||
|
String GLOBAL_REDIS_KEY = "global:"; |
||||
|
|
||||
|
/** |
||||
|
* 验证码 redis key |
||||
|
*/ |
||||
|
String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:"; |
||||
|
|
||||
|
/** |
||||
|
* 防重提交 redis key |
||||
|
*/ |
||||
|
String REPEAT_SUBMIT_KEY = GLOBAL_REDIS_KEY + "repeat_submit:"; |
||||
|
|
||||
|
/** |
||||
|
* 限流 redis key |
||||
|
*/ |
||||
|
String RATE_LIMIT_KEY = GLOBAL_REDIS_KEY + "rate_limit:"; |
||||
|
|
||||
|
/** |
||||
|
* 三方认证 redis key |
||||
|
*/ |
||||
|
String SOCIAL_AUTH_CODE_KEY = GLOBAL_REDIS_KEY + "social_auth_codes:"; |
||||
|
|
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 返回状态码 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface HttpStatus { |
||||
|
/** |
||||
|
* 操作成功 |
||||
|
*/ |
||||
|
int SUCCESS = 200; |
||||
|
|
||||
|
/** |
||||
|
* 对象创建成功 |
||||
|
*/ |
||||
|
int CREATED = 201; |
||||
|
|
||||
|
/** |
||||
|
* 请求已经被接受 |
||||
|
*/ |
||||
|
int ACCEPTED = 202; |
||||
|
|
||||
|
/** |
||||
|
* 操作已经执行成功,但是没有返回数据 |
||||
|
*/ |
||||
|
int NO_CONTENT = 204; |
||||
|
|
||||
|
/** |
||||
|
* 资源已被移除 |
||||
|
*/ |
||||
|
int MOVED_PERM = 301; |
||||
|
|
||||
|
/** |
||||
|
* 重定向 |
||||
|
*/ |
||||
|
int SEE_OTHER = 303; |
||||
|
|
||||
|
/** |
||||
|
* 资源没有被修改 |
||||
|
*/ |
||||
|
int NOT_MODIFIED = 304; |
||||
|
|
||||
|
/** |
||||
|
* 参数列表错误(缺少,格式不匹配) |
||||
|
*/ |
||||
|
int BAD_REQUEST = 400; |
||||
|
|
||||
|
/** |
||||
|
* 未授权 |
||||
|
*/ |
||||
|
int UNAUTHORIZED = 401; |
||||
|
|
||||
|
/** |
||||
|
* 访问受限,授权过期 |
||||
|
*/ |
||||
|
int FORBIDDEN = 403; |
||||
|
|
||||
|
/** |
||||
|
* 资源,服务未找到 |
||||
|
*/ |
||||
|
int NOT_FOUND = 404; |
||||
|
|
||||
|
/** |
||||
|
* 不允许的http方法 |
||||
|
*/ |
||||
|
int BAD_METHOD = 405; |
||||
|
|
||||
|
/** |
||||
|
* 资源冲突,或者资源被锁 |
||||
|
*/ |
||||
|
int CONFLICT = 409; |
||||
|
|
||||
|
/** |
||||
|
* 不支持的数据,媒体类型 |
||||
|
*/ |
||||
|
int UNSUPPORTED_TYPE = 415; |
||||
|
|
||||
|
/** |
||||
|
* 系统内部错误 |
||||
|
*/ |
||||
|
int ERROR = 500; |
||||
|
|
||||
|
/** |
||||
|
* 接口未实现 |
||||
|
*/ |
||||
|
int NOT_IMPLEMENTED = 501; |
||||
|
|
||||
|
/** |
||||
|
* 系统警告消息 |
||||
|
*/ |
||||
|
int WARN = 601; |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
import cn.hutool.core.lang.RegexPool; |
||||
|
|
||||
|
/** |
||||
|
* 常用正则表达式字符串 |
||||
|
* <p> |
||||
|
* 常用正则表达式集合,更多正则见: https://any86.github.io/any-rule/
|
||||
|
* |
||||
|
* @author Feng |
||||
|
*/ |
||||
|
public interface RegexConstants extends RegexPool { |
||||
|
|
||||
|
/** |
||||
|
* 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) |
||||
|
*/ |
||||
|
String DICTIONARY_TYPE = "^[a-z][a-z0-9_]*$"; |
||||
|
|
||||
|
/** |
||||
|
* 权限标识必须符合 tool:build:list 格式,或者空字符串 |
||||
|
*/ |
||||
|
String PERMISSION_STRING = "^(|^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+:[a-zA-Z0-9_]+)$"; |
||||
|
|
||||
|
/** |
||||
|
* 身份证号码(后6位) |
||||
|
*/ |
||||
|
String ID_CARD_LAST_6 = "^(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"; |
||||
|
|
||||
|
/** |
||||
|
* QQ号码 |
||||
|
*/ |
||||
|
String QQ_NUMBER = "^[1-9][0-9]\\d{4,9}$"; |
||||
|
|
||||
|
/** |
||||
|
* 邮政编码 |
||||
|
*/ |
||||
|
String POSTAL_CODE = "^[1-9]\\d{5}$"; |
||||
|
|
||||
|
/** |
||||
|
* 注册账号 |
||||
|
*/ |
||||
|
String ACCOUNT = "^[a-zA-Z][a-zA-Z0-9_]{4,15}$"; |
||||
|
|
||||
|
/** |
||||
|
* 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符 |
||||
|
*/ |
||||
|
String PASSWORD = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$"; |
||||
|
|
||||
|
/** |
||||
|
* 通用状态(0表示正常,1表示停用) |
||||
|
*/ |
||||
|
String STATUS = "^[01]$"; |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 租户常量信息 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
public interface TenantConstants { |
||||
|
|
||||
|
/** |
||||
|
* 租户正常状态 |
||||
|
*/ |
||||
|
String NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 租户封禁状态 |
||||
|
*/ |
||||
|
String DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 超级管理员ID |
||||
|
*/ |
||||
|
Long SUPER_ADMIN_ID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 超级管理员角色 roleKey |
||||
|
*/ |
||||
|
String SUPER_ADMIN_ROLE_KEY = "superadmin"; |
||||
|
|
||||
|
/** |
||||
|
* 租户管理员角色 roleKey |
||||
|
*/ |
||||
|
String TENANT_ADMIN_ROLE_KEY = "admin"; |
||||
|
|
||||
|
/** |
||||
|
* 租户管理员角色名称 |
||||
|
*/ |
||||
|
String TENANT_ADMIN_ROLE_NAME = "管理员"; |
||||
|
|
||||
|
/** |
||||
|
* 默认租户ID |
||||
|
*/ |
||||
|
String DEFAULT_TENANT_ID = "000000"; |
||||
|
|
||||
|
} |
@ -0,0 +1,152 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* 用户常量信息 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
public interface UserConstants { |
||||
|
|
||||
|
/** |
||||
|
* 平台内系统用户的唯一标志 |
||||
|
*/ |
||||
|
String SYS_USER = "SYS_USER"; |
||||
|
|
||||
|
/** |
||||
|
* 正常状态 |
||||
|
*/ |
||||
|
String NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 异常状态 |
||||
|
*/ |
||||
|
String EXCEPTION = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 用户正常状态 |
||||
|
*/ |
||||
|
String USER_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 用户封禁状态 |
||||
|
*/ |
||||
|
String USER_DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 角色正常状态 |
||||
|
*/ |
||||
|
String ROLE_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 角色封禁状态 |
||||
|
*/ |
||||
|
String ROLE_DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 部门正常状态 |
||||
|
*/ |
||||
|
String DEPT_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 部门停用状态 |
||||
|
*/ |
||||
|
String DEPT_DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 岗位正常状态 |
||||
|
*/ |
||||
|
String POST_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 岗位停用状态 |
||||
|
*/ |
||||
|
String POST_DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 字典正常状态 |
||||
|
*/ |
||||
|
String DICT_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 通用存在标志 |
||||
|
*/ |
||||
|
String DEL_FLAG_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 通用删除标志 |
||||
|
*/ |
||||
|
String DEL_FLAG_REMOVED = "2"; |
||||
|
|
||||
|
/** |
||||
|
* 是否为系统默认(是) |
||||
|
*/ |
||||
|
String YES = "Y"; |
||||
|
|
||||
|
/** |
||||
|
* 是否菜单外链(是) |
||||
|
*/ |
||||
|
String YES_FRAME = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 是否菜单外链(否) |
||||
|
*/ |
||||
|
String NO_FRAME = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 菜单正常状态 |
||||
|
*/ |
||||
|
String MENU_NORMAL = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 菜单停用状态 |
||||
|
*/ |
||||
|
String MENU_DISABLE = "1"; |
||||
|
|
||||
|
/** |
||||
|
* 菜单类型(目录) |
||||
|
*/ |
||||
|
String TYPE_DIR = "M"; |
||||
|
|
||||
|
/** |
||||
|
* 菜单类型(菜单) |
||||
|
*/ |
||||
|
String TYPE_MENU = "C"; |
||||
|
|
||||
|
/** |
||||
|
* 菜单类型(按钮) |
||||
|
*/ |
||||
|
String TYPE_BUTTON = "F"; |
||||
|
|
||||
|
/** |
||||
|
* Layout组件标识 |
||||
|
*/ |
||||
|
String LAYOUT = "Layout"; |
||||
|
|
||||
|
/** |
||||
|
* ParentView组件标识 |
||||
|
*/ |
||||
|
String PARENT_VIEW = "ParentView"; |
||||
|
|
||||
|
/** |
||||
|
* InnerLink组件标识 |
||||
|
*/ |
||||
|
String INNER_LINK = "InnerLink"; |
||||
|
|
||||
|
/** |
||||
|
* 用户名长度限制 |
||||
|
*/ |
||||
|
int USERNAME_MIN_LENGTH = 2; |
||||
|
int USERNAME_MAX_LENGTH = 20; |
||||
|
|
||||
|
/** |
||||
|
* 密码长度限制 |
||||
|
*/ |
||||
|
int PASSWORD_MIN_LENGTH = 5; |
||||
|
int PASSWORD_MAX_LENGTH = 20; |
||||
|
|
||||
|
/** |
||||
|
* 超级管理员ID |
||||
|
*/ |
||||
|
Long SUPER_ADMIN_ID = 1L; |
||||
|
|
||||
|
} |
@ -0,0 +1,120 @@ |
|||||
|
package org.dromara.common.core.domain; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.dromara.common.core.constant.HttpStatus; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 响应信息主体 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class R<T> implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 成功 |
||||
|
*/ |
||||
|
public static final int SUCCESS = 200; |
||||
|
|
||||
|
/** |
||||
|
* 失败 |
||||
|
*/ |
||||
|
public static final int FAIL = 500; |
||||
|
|
||||
|
/** |
||||
|
* 消息状态码 |
||||
|
*/ |
||||
|
private int code; |
||||
|
|
||||
|
/** |
||||
|
* 消息内容 |
||||
|
*/ |
||||
|
private String msg; |
||||
|
|
||||
|
/** |
||||
|
* 数据对象 |
||||
|
*/ |
||||
|
private T data; |
||||
|
|
||||
|
public static <T> R<T> ok() { |
||||
|
return restResult(null, SUCCESS, "操作成功"); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> ok(T data) { |
||||
|
return restResult(data, SUCCESS, "操作成功"); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> ok(String msg) { |
||||
|
return restResult(null, SUCCESS, msg); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> ok(String msg, T data) { |
||||
|
return restResult(data, SUCCESS, msg); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> fail() { |
||||
|
return restResult(null, FAIL, "操作失败"); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> fail(String msg) { |
||||
|
return restResult(null, FAIL, msg); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> fail(T data) { |
||||
|
return restResult(data, FAIL, "操作失败"); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> fail(String msg, T data) { |
||||
|
return restResult(data, FAIL, msg); |
||||
|
} |
||||
|
|
||||
|
public static <T> R<T> fail(int code, String msg) { |
||||
|
return restResult(null, code, msg); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 返回警告消息 |
||||
|
* |
||||
|
* @param msg 返回内容 |
||||
|
* @return 警告消息 |
||||
|
*/ |
||||
|
public static <T> R<T> warn(String msg) { |
||||
|
return restResult(null, HttpStatus.WARN, msg); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 返回警告消息 |
||||
|
* |
||||
|
* @param msg 返回内容 |
||||
|
* @param data 数据对象 |
||||
|
* @return 警告消息 |
||||
|
*/ |
||||
|
public static <T> R<T> warn(String msg, T data) { |
||||
|
return restResult(data, HttpStatus.WARN, msg); |
||||
|
} |
||||
|
|
||||
|
private static <T> R<T> restResult(T data, int code, String msg) { |
||||
|
R<T> r = new R<>(); |
||||
|
r.setCode(code); |
||||
|
r.setData(data); |
||||
|
r.setMsg(msg); |
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
public static <T> Boolean isError(R<T> ret) { |
||||
|
return !isSuccess(ret); |
||||
|
} |
||||
|
|
||||
|
public static <T> Boolean isSuccess(R<T> ret) { |
||||
|
return R.SUCCESS == ret.getCode(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package org.dromara.common.core.domain.model; |
||||
|
|
||||
|
import jakarta.validation.constraints.NotBlank; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* 用户登录对象 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class LoginBody { |
||||
|
|
||||
|
/** |
||||
|
* 客户端id |
||||
|
*/ |
||||
|
@NotBlank(message = "{auth.clientid.not.blank}") |
||||
|
private String clientId; |
||||
|
|
||||
|
/** |
||||
|
* 授权类型 |
||||
|
*/ |
||||
|
@NotBlank(message = "{auth.grant.type.not.blank}") |
||||
|
private String grantType; |
||||
|
|
||||
|
/** |
||||
|
* 租户ID |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 验证码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 唯一标识 |
||||
|
*/ |
||||
|
private String uuid; |
||||
|
|
||||
|
} |
@ -0,0 +1,152 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
|
||||
|
/** |
||||
|
* 业务状态枚举 |
||||
|
* |
||||
|
* @author may |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum BusinessStatusEnum { |
||||
|
/** |
||||
|
* 已撤销 |
||||
|
*/ |
||||
|
CANCEL("cancel", "已撤销"), |
||||
|
/** |
||||
|
* 草稿 |
||||
|
*/ |
||||
|
DRAFT("draft", "草稿"), |
||||
|
/** |
||||
|
* 待审核 |
||||
|
*/ |
||||
|
WAITING("waiting", "待审核"), |
||||
|
/** |
||||
|
* 已完成 |
||||
|
*/ |
||||
|
FINISH("finish", "已完成"), |
||||
|
/** |
||||
|
* 已作废 |
||||
|
*/ |
||||
|
INVALID("invalid", "已作废"), |
||||
|
/** |
||||
|
* 已退回 |
||||
|
*/ |
||||
|
BACK("back", "已退回"), |
||||
|
/** |
||||
|
* 已终止 |
||||
|
*/ |
||||
|
TERMINATION("termination", "已终止"); |
||||
|
|
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private final String status; |
||||
|
|
||||
|
/** |
||||
|
* 描述 |
||||
|
*/ |
||||
|
private final String desc; |
||||
|
|
||||
|
/** |
||||
|
* 获取业务状态 |
||||
|
* |
||||
|
* @param status 状态 |
||||
|
*/ |
||||
|
public static String findByStatus(String status) { |
||||
|
if (StringUtils.isBlank(status)) { |
||||
|
return StrUtil.EMPTY; |
||||
|
} |
||||
|
return Arrays.stream(BusinessStatusEnum.values()) |
||||
|
.filter(statusEnum -> statusEnum.getStatus().equals(status)) |
||||
|
.findFirst() |
||||
|
.map(BusinessStatusEnum::getDesc) |
||||
|
.orElse(StrUtil.EMPTY); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 启动流程校验 |
||||
|
* |
||||
|
* @param status 状态 |
||||
|
*/ |
||||
|
public static void checkStartStatus(String status) { |
||||
|
if (WAITING.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已提交过申请,正在审批中!"); |
||||
|
} else if (FINISH.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已完成申请!"); |
||||
|
} else if (INVALID.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已作废!"); |
||||
|
} else if (TERMINATION.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已终止!"); |
||||
|
} else if (StringUtils.isBlank(status)) { |
||||
|
throw new ServiceException("流程状态为空!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 撤销流程校验 |
||||
|
* |
||||
|
* @param status 状态 |
||||
|
*/ |
||||
|
public static void checkCancelStatus(String status) { |
||||
|
if (CANCEL.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已撤销!"); |
||||
|
} else if (FINISH.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已完成申请!"); |
||||
|
} else if (INVALID.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已作废!"); |
||||
|
} else if (TERMINATION.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已终止!"); |
||||
|
} else if (BACK.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已退回!"); |
||||
|
} else if (StringUtils.isBlank(status)) { |
||||
|
throw new ServiceException("流程状态为空!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 驳回流程校验 |
||||
|
* |
||||
|
* @param status 状态 |
||||
|
*/ |
||||
|
public static void checkBackStatus(String status) { |
||||
|
if (BACK.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已退回!"); |
||||
|
} else if (FINISH.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已完成申请!"); |
||||
|
} else if (INVALID.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已作废!"); |
||||
|
} else if (TERMINATION.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已终止!"); |
||||
|
} else if (CANCEL.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已撤销!"); |
||||
|
} else if (StringUtils.isBlank(status)) { |
||||
|
throw new ServiceException("流程状态为空!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废,终止流程校验 |
||||
|
* |
||||
|
* @param status 状态 |
||||
|
*/ |
||||
|
public static void checkInvalidStatus(String status) { |
||||
|
if (FINISH.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已完成申请!"); |
||||
|
} else if (INVALID.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已作废!"); |
||||
|
} else if (TERMINATION.getStatus().equals(status)) { |
||||
|
throw new ServiceException("该单据已终止!"); |
||||
|
} else if (StringUtils.isBlank(status)) { |
||||
|
throw new ServiceException("流程状态为空!"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,32 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
* 针对一套 用户体系 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum DeviceType { |
||||
|
|
||||
|
/** |
||||
|
* pc端 |
||||
|
*/ |
||||
|
PC("pc"), |
||||
|
|
||||
|
/** |
||||
|
* app端 |
||||
|
*/ |
||||
|
APP("app"), |
||||
|
|
||||
|
/** |
||||
|
* 小程序端 |
||||
|
*/ |
||||
|
XCX("xcx"); |
||||
|
|
||||
|
private final String device; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 登录类型 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum LoginType { |
||||
|
|
||||
|
/** |
||||
|
* 密码登录 |
||||
|
*/ |
||||
|
PASSWORD("user.password.retry.limit.exceed", "user.password.retry.limit.count"), |
||||
|
|
||||
|
/** |
||||
|
* 短信登录 |
||||
|
*/ |
||||
|
SMS("sms.code.retry.limit.exceed", "sms.code.retry.limit.count"), |
||||
|
|
||||
|
/** |
||||
|
* 邮箱登录 |
||||
|
*/ |
||||
|
EMAIL("email.code.retry.limit.exceed", "email.code.retry.limit.count"), |
||||
|
|
||||
|
/** |
||||
|
* 小程序登录 |
||||
|
*/ |
||||
|
XCX("", ""); |
||||
|
|
||||
|
/** |
||||
|
* 登录重试超出限制提示 |
||||
|
*/ |
||||
|
final String retryLimitExceed; |
||||
|
|
||||
|
/** |
||||
|
* 登录重试限制计数提示 |
||||
|
*/ |
||||
|
final String retryLimitCount; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 用户状态 |
||||
|
* |
||||
|
* @author LionLi |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum TenantStatus { |
||||
|
/** |
||||
|
* 正常 |
||||
|
*/ |
||||
|
OK("0", "正常"), |
||||
|
/** |
||||
|
* 停用 |
||||
|
*/ |
||||
|
DISABLE("1", "停用"), |
||||
|
/** |
||||
|
* 删除 |
||||
|
*/ |
||||
|
DELETED("2", "删除"); |
||||
|
|
||||
|
private final String code; |
||||
|
private final String info; |
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 用户状态 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum UserStatus { |
||||
|
/** |
||||
|
* 正常 |
||||
|
*/ |
||||
|
OK("0", "正常"), |
||||
|
/** |
||||
|
* 停用 |
||||
|
*/ |
||||
|
DISABLE("1", "停用"), |
||||
|
/** |
||||
|
* 删除 |
||||
|
*/ |
||||
|
DELETED("2", "删除"); |
||||
|
|
||||
|
private final String code; |
||||
|
private final String info; |
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package org.dromara.common.core.enums; |
||||
|
|
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 设备类型 |
||||
|
* 针对多套 用户体系 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
*/ |
||||
|
@Getter |
||||
|
@AllArgsConstructor |
||||
|
public enum UserType { |
||||
|
|
||||
|
/** |
||||
|
* pc端 |
||||
|
*/ |
||||
|
SYS_USER("sys_user"), |
||||
|
|
||||
|
/** |
||||
|
* app端 |
||||
|
*/ |
||||
|
APP_USER("app_user"); |
||||
|
|
||||
|
private final String userType; |
||||
|
|
||||
|
public static UserType getUserType(String str) { |
||||
|
for (UserType value : values()) { |
||||
|
if (StringUtils.contains(str, value.getUserType())) { |
||||
|
return value; |
||||
|
} |
||||
|
} |
||||
|
throw new RuntimeException("'UserType' not found By " + str); |
||||
|
} |
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue