diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md index a8f3fe31d..06e3de7c2 100644 --- a/.gitee/ISSUE_TEMPLATE.zh-CN.md +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -1,9 +1,17 @@ +碰到问题,请在 搜索是否存在相似的 issue。 + +不按照模板提交的 issue,会被系统自动删除。 + ### 基本信息 - ruoyi-vue-pro 版本: - 操作系统: - 数据库: +### 你猜测可能的原因 + +(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx + ### 复现步骤 第一步, @@ -14,13 +22,4 @@ ### 报错信息 -[截图] - -[截图] - ---- - -建议:项目不是很难,碰到问题时,建议先花 2-4 小时的时间进行自查。 - -Issue 中如果带上自己的分析,可以被更快更高效的解决。 - +带上必要的截图 diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index af30c51c0..6ed00a35c 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -7,12 +7,20 @@ assignees: '' --- +碰到问题,请在 搜索是否存在相似的 issue。 + +不按照模板提交的 issue,会被系统自动删除。 + ### 基本信息 - ruoyi-vue-pro 版本: - 操作系统: - 数据库: +### 你猜测可能的原因 + +(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx + ### 复现步骤 第一步, @@ -23,12 +31,4 @@ assignees: '' ### 报错信息 -[截图] - -[截图] - ---- - -建议:项目不是很难,碰到问题时,建议先花 2-4 小时的时间进行自查。 - -Issue 中如果带上自己的分析,可以被更快更高效的解决。 +带上必要的截图 diff --git a/README.md b/README.md index eee2a451c..2ec6a211f 100644 --- a/README.md +++ b/README.md @@ -157,27 +157,27 @@ ps:核心功能已经实现,正在对接微信小程序中... | 框架 | 说明 | 版本 | 学习指南 | |---------------------------------------------------------------------------------------------|------------------|----------|----------------------------------------------------------------| -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.5.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.8 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 | | | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.8 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | -| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | +| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | [Redis](https://redis.io/) | key-value 数据库 | 5.0 | | -| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.16.8 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | -| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.16 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | -| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.5.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | -| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.2 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | +| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.3 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | +| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | +| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | +| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.0 | [文档](https://doc.iocoder.cn/bpm/) | | [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | -| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.2 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | -| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.0 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | +| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | +| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | -| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.4.2 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | -| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.12.6 | | +| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.7 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | +| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.4.1 | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | | [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.16.14 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | -| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.7.2 | - | -| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 3.9.0 | - | +| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | +| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.0.0 | - | ### 前端 @@ -192,42 +192,41 @@ ps:核心功能已经实现,正在对接微信小程序中... | 模块 | biu | biu | biu | |----------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------| -| 登录 & 首页 | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg) | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg) | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg) | -| 用户 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg) | ![在线用户](https://static.iocoder.cn/images/ruoyi-vue-pro/在线用户.jpg) | - | -| 租户 & 套餐 | ![租户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/租户管理.jpg) | ![租户套餐](https://static.iocoder.cn/images/ruoyi-vue-pro/租户套餐.png) | - | -| 部门 & 岗位 | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg) | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg) | - | -| 菜单 & 角色 | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg) | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg) | - | -| 审计日志 | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg) | ![登录日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登录日志.jpg) | - | -| 短信 | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg) | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg) | -| 字典 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg) | - | -| 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg) | - | +| 登录 & 首页 | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg?imageView2/2/format/webp/w/1280) | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg?imageView2/2/format/webp/w/1280) | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg?imageView2/2/format/webp/w/1280) | +| 用户 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280) | ![在线用户](https://static.iocoder.cn/images/ruoyi-vue-pro/在线用户.jpg?imageView2/2/format/webp/w/1280) | - | +| 租户 & 套餐 | ![租户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/租户管理.jpg?imageView2/2/format/webp/w/1280) | ![租户套餐](https://static.iocoder.cn/images/ruoyi-vue-pro/租户套餐.png) | - | +| 部门 & 岗位 | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg?imageView2/2/format/webp/w/1280) | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg?imageView2/2/format/webp/w/1280) | - | +| 菜单 & 角色 | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg?imageView2/2/format/webp/w/1280) | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg?imageView2/2/format/webp/w/1280) | - | +| 审计日志 | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg?imageView2/2/format/webp/w/1280) | ![登录日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登录日志.jpg?imageView2/2/format/webp/w/1280) | - | +| 短信 | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg?imageView2/2/format/webp/w/1280) | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg?imageView2/2/format/webp/w/1280) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg?imageView2/2/format/webp/w/1280) | +| 字典 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | - | +| 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg?imageView2/2/format/webp/w/1280) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg?imageView2/2/format/webp/w/1280) | - | ### 工作流程 | 模块 | biu | biu | biu | |---------|------------------------------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------------------------------| -| 流程模型 | ![流程模型-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-列表.jpg) | ![流程模型-设计](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-设计.jpg) | ![流程模型-定义](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-定义.jpg) | -| 表单 & 分组 | ![流程表单](https://static.iocoder.cn/images/ruoyi-vue-pro/流程表单.jpg) | ![用户分组](https://static.iocoder.cn/images/ruoyi-vue-pro/用户分组.jpg) | - | -| 我的流程 | ![我的流程-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-列表.jpg) | ![我的流程-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-发起.jpg) | ![我的流程-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-详情.jpg) | -| 待办 & 已办 | ![任务列表-审批](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-审批.jpg) | ![任务列表-待办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-待办.jpg) | ![任务列表-已办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-已办.jpg) | -| OA 请假 | ![OA请假-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-列表.jpg) | ![OA请假-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-发起.jpg) | ![OA请假-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-详情.jpg) | - -### 支付系统 - -| 模块 | biu | biu | biu | -|---------|------------------------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------------------------------| -| 商家 & 应用 | ![商户信息](https://static.iocoder.cn/images/ruoyi-vue-pro/商户信息.jpg) | ![应用信息-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-列表.jpg) | ![应用信息-编辑](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-编辑.jpg) | -| 支付 & 退款 | ![支付订单](https://static.iocoder.cn/images/ruoyi-vue-pro/支付订单.jpg) | ![退款订单](https://static.iocoder.cn/images/ruoyi-vue-pro/退款订单.jpg) | --- | +| 流程模型 | ![流程模型-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-列表.jpg?imageView2/2/format/webp/w/1280) | ![流程模型-设计](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-设计.jpg?imageView2/2/format/webp/w/1280) | ![流程模型-定义](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-定义.jpg?imageView2/2/format/webp/w/1280) | +| 表单 & 分组 | ![流程表单](https://static.iocoder.cn/images/ruoyi-vue-pro/流程表单.jpg?imageView2/2/format/webp/w/1280) | ![用户分组](https://static.iocoder.cn/images/ruoyi-vue-pro/用户分组.jpg?imageView2/2/format/webp/w/1280) | - | +| 我的流程 | ![我的流程-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-列表.jpg?imageView2/2/format/webp/w/1280) | ![我的流程-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-发起.jpg?imageView2/2/format/webp/w/1280) | ![我的流程-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-详情.jpg?imageView2/2/format/webp/w/1280) | +| 待办 & 已办 | ![任务列表-审批](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-审批.jpg?imageView2/2/format/webp/w/1280) | ![任务列表-待办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-待办.jpg?imageView2/2/format/webp/w/1280) | ![任务列表-已办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-已办.jpg?imageView2/2/format/webp/w/1280) | +| OA 请假 | ![OA请假-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-列表.jpg?imageView2/2/format/webp/w/1280) | ![OA请假-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-发起.jpg?imageView2/2/format/webp/w/1280) | ![OA请假-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-详情.jpg?imageView2/2/format/webp/w/1280) | ### 基础设施 | 模块 | biu | biu | biu | |---------------|----------------------------------------------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------| -| 代码生成 | ![代码生成](https://static.iocoder.cn/images/ruoyi-vue-pro/代码生成.jpg) | ![生成效果](https://static.iocoder.cn/images/ruoyi-vue-pro/生成效果.jpg) | - | -| 文档 | ![系统接口](https://static.iocoder.cn/images/ruoyi-vue-pro/系统接口.jpg) | ![数据库文档](https://static.iocoder.cn/images/ruoyi-vue-pro/数据库文档.jpg) | - | -| 文件 & 配置 | ![文件配置](https://static.iocoder.cn/images/ruoyi-vue-pro/文件配置.jpg) | ![文件管理](https://static.iocoder.cn/images/ruoyi-vue-pro/文件管理2.jpg) | ![配置管理](https://static.iocoder.cn/images/ruoyi-vue-pro/配置管理.jpg) | -| 定时任务 | ![定时任务](https://static.iocoder.cn/images/ruoyi-vue-pro/定时任务.jpg) | ![任务日志](https://static.iocoder.cn/images/ruoyi-vue-pro/任务日志.jpg) | - | -| API 日志 | ![访问日志](https://static.iocoder.cn/images/ruoyi-vue-pro/访问日志.jpg) | ![错误日志](https://static.iocoder.cn/images/ruoyi-vue-pro/错误日志.jpg) | - | -| MySQL & Redis | ![MySQL](https://static.iocoder.cn/images/ruoyi-vue-pro/MySQL.jpg) | ![Redis](https://static.iocoder.cn/images/ruoyi-vue-pro/Redis.jpg) | - | -| 监控平台 | ![Java监控](https://static.iocoder.cn/images/ruoyi-vue-pro/Java监控.jpg) | ![链路追踪](https://static.iocoder.cn/images/ruoyi-vue-pro/链路追踪.jpg) | ![日志中心](https://static.iocoder.cn/images/ruoyi-vue-pro/日志中心.jpg) | +| 代码生成 | ![代码生成](https://static.iocoder.cn/images/ruoyi-vue-pro/代码生成.jpg?imageView2/2/format/webp/w/1280) | ![生成效果](https://static.iocoder.cn/images/ruoyi-vue-pro/生成效果.jpg?imageView2/2/format/webp/w/1280) | - | +| 文档 | ![系统接口](https://static.iocoder.cn/images/ruoyi-vue-pro/系统接口.jpg?imageView2/2/format/webp/w/1280) | ![数据库文档](https://static.iocoder.cn/images/ruoyi-vue-pro/数据库文档.jpg?imageView2/2/format/webp/w/1280) | - | +| 文件 & 配置 | ![文件配置](https://static.iocoder.cn/images/ruoyi-vue-pro/文件配置.jpg?imageView2/2/format/webp/w/1280) | ![文件管理](https://static.iocoder.cn/images/ruoyi-vue-pro/文件管理2.jpg?imageView2/2/format/webp/w/1280) | ![配置管理](https://static.iocoder.cn/images/ruoyi-vue-pro/配置管理.jpg?imageView2/2/format/webp/w/1280) | +| 定时任务 | ![定时任务](https://static.iocoder.cn/images/ruoyi-vue-pro/定时任务.jpg?imageView2/2/format/webp/w/1280) | ![任务日志](https://static.iocoder.cn/images/ruoyi-vue-pro/任务日志.jpg?imageView2/2/format/webp/w/1280) | - | +| API 日志 | ![访问日志](https://static.iocoder.cn/images/ruoyi-vue-pro/访问日志.jpg?imageView2/2/format/webp/w/1280) | ![错误日志](https://static.iocoder.cn/images/ruoyi-vue-pro/错误日志.jpg?imageView2/2/format/webp/w/1280) | - | +| MySQL & Redis | ![MySQL](https://static.iocoder.cn/images/ruoyi-vue-pro/MySQL.jpg?imageView2/2/format/webp/w/1280) | ![Redis](https://static.iocoder.cn/images/ruoyi-vue-pro/Redis.jpg?imageView2/2/format/webp/w/1280) | - | +| 监控平台 | ![Java监控](https://static.iocoder.cn/images/ruoyi-vue-pro/Java监控.jpg?imageView2/2/format/webp/w/1280) | ![链路追踪](https://static.iocoder.cn/images/ruoyi-vue-pro/链路追踪.jpg?imageView2/2/format/webp/w/1280) | ![日志中心](https://static.iocoder.cn/images/ruoyi-vue-pro/日志中心.jpg?imageView2/2/format/webp/w/1280) | +### 支付系统 + +| 模块 | biu | biu | biu | +|---------|------------------------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------------------------------| +| 商家 & 应用 | ![商户信息](https://static.iocoder.cn/images/ruoyi-vue-pro/商户信息.jpg?imageView2/2/format/webp/w/1280) | ![应用信息-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-列表.jpg?imageView2/2/format/webp/w/1280) | ![应用信息-编辑](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-编辑.jpg?imageView2/2/format/webp/w/1280) | +| 支付 & 退款 | ![支付订单](https://static.iocoder.cn/images/ruoyi-vue-pro/支付订单.jpg?imageView2/2/format/webp/w/1280) | ![退款订单](https://static.iocoder.cn/images/ruoyi-vue-pro/退款订单.jpg?imageView2/2/format/webp/w/1280) | --- | diff --git a/http-client.env.json b/http-client.env.json index 2f18d251c..d2ad9e7c2 100644 --- a/http-client.env.json +++ b/http-client.env.json @@ -7,5 +7,14 @@ "appApi": "http://127.0.0.1:48080/app-api", "appToken": "test1", "appTenentId": "1" + }, + "gateway": { + "baseUrl": "http://127.0.0.1:8888/admin-api", + "token": "test1", + "adminTenentId": "1", + + "appApi": "http://127.0.0.1:8888/app-api", + "appToken": "test1", + "appTenentId": "1" } } diff --git a/pom.xml b/pom.xml index b3ea38a1a..e3c5072ab 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ yudao-module-system yudao-module-infra yudao-module-pay + yudao-module-mall ${project.artifactId} diff --git a/sql/mall.sql b/sql/mall.sql new file mode 100644 index 000000000..9493c3bcf --- /dev/null +++ b/sql/mall.sql @@ -0,0 +1,287 @@ +/* + Navicat Premium Data Transfer + + Source Server : 127.0.0.1 + Source Server Type : MySQL + Source Server Version : 80026 + Source Host : localhost:3306 + Source Schema : ruoyi-vue-pro + + Target Server Type : MySQL + Target Server Version : 80026 + File Encoding : 65001 + + Date: 05/02/2022 00:50:30 +*/ +SET +FOREIGN_KEY_CHECKS = 0; +SET NAMES utf8mb4; + +-- ---------------------------- +-- Table structure for product_category +-- ---------------------------- +DROP TABLE IF EXISTS `product_category`; +CREATE TABLE `product_category` +( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类编号', + `parent_id` bigint NOT NULL COMMENT '父分类编号', + `name` varchar(255) NOT NULL COMMENT '分类名称', + `icon` varchar(100) NOT NULL DEFAULT '#' COMMENT '分类图标', + `banner_url` varchar(255) NOT NULL COMMENT '分类图片', + `sort` int DEFAULT '0' COMMENT '分类排序', + `description` varchar(1024) DEFAULT NULL COMMENT '分类描述', + `status` tinyint NOT NULL COMMENT '开启状态', + `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB COMMENT='商品分类'; + +-- ---------------------------- +-- Table structure for product_brand +-- ---------------------------- +DROP TABLE IF EXISTS `product_brand`; +CREATE TABLE `product_brand` +( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '品牌编号', + `category_id` bigint NOT NULL COMMENT '分类编号', + `name` varchar(255) NOT NULL COMMENT '品牌名称', + `banner_url` varchar(255) NOT NULL COMMENT '品牌图片', + `sort` int DEFAULT '0' COMMENT '品牌排序', + `description` varchar(1024) DEFAULT NULL COMMENT '品牌描述', + `status` tinyint NOT NULL COMMENT '状态', + `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB COMMENT='品牌'; + +-- TODO 父级菜单的 id 处理: 2000 、 2001 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES (2000, '商城', '', 1, 1, 0, '/mall', 'merchant', NULL, 0); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES (2001, '商品', '', 1, 1, 2000, 'product', 'dict', NULL, 0); +-- 商品分类 菜单 SQL +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类管理', '', 2, 0, 2001, 'category', '', 'mall/product/category/index', 0); +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); +-- 按钮 SQL +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类查询', 'product:category:query', 3, 1, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类创建', 'product:category:create', 3, 2, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类更新', 'product:category:update', 3, 3, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类删除', 'product:category:delete', 3, 4, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('分类导出', 'product:category:export', 3, 5, @parentId, '', '', '', 0); +-- 品牌管理 菜单 SQL +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌管理', '', 2, 1, 2001, 'brand', '', 'mall/product/brand/index', 0); +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); +-- 按钮 SQL +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌查询', 'product:brand:query', 3, 1, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌创建', 'product:brand:create', 3, 2, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌更新', 'product:brand:update', 3, 3, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌删除', 'product:brand:delete', 3, 4, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('品牌导出', 'product:brand:export', 3, 5, @parentId, '', '', '', 0); + + +-- ---------------------------- +-- Table structure for market_activity +-- ---------------------------- +DROP TABLE IF EXISTS `market_activity`; +CREATE TABLE `market_activity` +( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '活动编号', + `title` varchar(50) NOT NULL DEFAULT '' COMMENT '活动标题', + `activity_type` tinyint(4) NOT NULL COMMENT '活动类型', + `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态', + `start_time` datetime NOT NULL COMMENT '开始时间', + `end_time` datetime NOT NULL COMMENT '结束时间', + `invalid_time` datetime DEFAULT NULL COMMENT '失效时间', + `delete_time` datetime DEFAULT NULL COMMENT '删除时间', + `time_limited_discount` varchar(2000) DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', + `full_privilege` varchar(2000) DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', + `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='促销活动'; + + +-- 规格菜单 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格管理', '', 2, 3, 2001, 'property', '', 'mall/product/property/index', 0); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格查询', 'product:property:query', 3, 1, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格创建', 'product:property:create', 3, 2, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格更新', 'product:property:update', 3, 3, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格删除', 'product:property:delete', 3, 4, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('规格导出', 'product:property:export', 3, 5, @parentId, '', '', '', 0); + + +-- 商品菜单 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品管理', '', 2, 2, 2001, 'spu', '', 'mall/product/spu/index', 0); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品查询', 'product:spu:query', 3, 1, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品创建', 'product:spu:create', 3, 2, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品更新', 'product:spu:update', 3, 3, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品删除', 'product:spu:delete', 3, 4, @parentId, '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) +VALUES ('商品导出', 'product:spu:export', 3, 5, @parentId, '', '', '', 0); + + +-- 规格名称表 +drop table if exists product_property; +create table product_property +( + id bigint NOT NULL AUTO_INCREMENT comment '主键', + name varchar(64) comment '规格名称', + status tinyint comment '状态: 0 开启 ,1 禁用', + create_time datetime default current_timestamp comment '创建时间', + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', + creator varchar(64) comment '创建人', + updater varchar(64) comment '更新人', + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + deleted bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + primary key (id), + key idx_name ( name (32)) comment '规格名称索引' +) comment '规格名称' character set utf8mb4 + collate utf8mb4_general_ci; + +-- 规格值表 +drop table if exists product_property_value; +create table product_property_value +( + id bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + property_id bigint comment '规格键id', + name varchar(128) comment '规格值名字', + status tinyint comment '状态: 1 开启 ,2 禁用', + create_time datetime default current_timestamp comment '创建时间', + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', + creator varchar(64) comment '创建人', + updater varchar(64) comment '更新人', + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + deleted bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + primary key (id) +) comment '规格值' character set utf8mb4 + collate utf8mb4_general_ci; + +-- spu +drop table if exists product_spu; +create table product_spu +( + id bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + name varchar(128) comment '商品名称', + sell_point varchar(128) not null comment '卖点', + description text not null comment '描述', + category_id bigint not null comment '分类id', + pic_urls varchar(1024) not null default '' comment '商品主图地址\n *\n * 数组,以逗号分隔\n 最多上传15张', + sort int not null default 0 comment '排序字段', + like_count int comment '点赞初始人数', + price int comment '价格 单位使用:分', + quantity int comment '库存数量', + status bit(1) comment '上下架状态: 0 上架(开启) 1 下架(禁用)', + create_time datetime default current_timestamp comment '创建时间', + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', + creator varchar(64) comment '创建人', + updater varchar(64) comment '更新人', + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + deleted bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + primary key (id) +) comment '商品spu' character set utf8mb4 + collate utf8mb4_general_ci; + + +-- sku +drop table if exists product_sku; +create table product_sku +( + id bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + spu_id bigint not null comment 'spu编号', + properties varchar(64) not null comment '规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]', + price int not null DEFAULT -1 comment '销售价格,单位:分', + original_price int not null DEFAULT -1 comment '原价, 单位: 分', + cost_price int not null DEFAULT -1 comment '成本价,单位: 分', + bar_code varchar(64) not null comment '条形码', + pic_url VARCHAR(128) not null comment '图片地址', + status tinyint comment '状态: 0-正常 1-禁用', + create_time datetime default current_timestamp comment '创建时间', + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', + creator varchar(64) comment '创建人', + updater varchar(64) comment '更新人', + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', + deleted bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + primary key (id) +) comment '商品sku' character set utf8mb4 + collate utf8mb4_general_ci; + + +---Market-Banner管理SQL +drop table if exists market_banner; +CREATE TABLE `market_banner` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Banner编号', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT 'Banner标题', + `pic_url` varchar(255) NOT NULL COMMENT '图片URL', + `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态', + `url` varchar(255) NOT NULL COMMENT '跳转地址', + `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号', + `sort` tinyint(4) DEFAULT NULL COMMENT '排序', + `memo` varchar(255) DEFAULT NULL COMMENT '描述', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='Banner管理'; +-- 菜单 SQL +INSERT INTO `system_menu`(`id`,`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES (2002, 'Banner管理', '', 2, 1, 2000, 'brand', '', 'mall/market/banner/index', 0); +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); +-- 按钮 SQL +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('Banner查询', 'market:banner:query', 3, 1, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('Banner创建', 'market:banner:create', 3, 2, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('Banner更新', 'market:banner:update', 3, 3, @parentId, '', '', '', 0); +INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) +VALUES ('Banner删除', 'market:banner:delete', 3, 4, @parentId, '', '', '', 0); diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index 8029f1243..a014a1b8c 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -11,7 +11,7 @@ Target Server Version : 80026 File Encoding : 65001 - Date: 13/05/2022 00:25:55 + Date: 15/06/2022 08:11:25 */ SET NAMES utf8mb4; @@ -300,7 +300,7 @@ CREATE TABLE `bpm_form` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的表单定义'; +) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的表单定义'; -- ---------------------------- -- Records of bpm_form @@ -359,7 +359,7 @@ CREATE TABLE `bpm_process_definition_ext` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 98 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 流程定义的拓展表\n'; +) ENGINE = InnoDB AUTO_INCREMENT = 119 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 流程定义的拓展表\n'; -- ---------------------------- -- Records of bpm_process_definition_ext @@ -389,7 +389,7 @@ CREATE TABLE `bpm_process_instance_ext` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 201 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程实例的拓展'; +) ENGINE = InnoDB AUTO_INCREMENT = 256 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程实例的拓展'; -- ---------------------------- -- Records of bpm_process_instance_ext @@ -415,7 +415,7 @@ CREATE TABLE `bpm_task_assign_rule` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 192 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; +) ENGINE = InnoDB AUTO_INCREMENT = 225 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; -- ---------------------------- -- Records of bpm_task_assign_rule @@ -431,6 +431,7 @@ CREATE TABLE `bpm_task_ext` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `assignee_user_id` bigint NULL DEFAULT NULL COMMENT '任务的审批人', `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务的名字', + `task_def_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '流程任务key', `task_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '任务的编号', `result` tinyint NOT NULL COMMENT '任务的结果', `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批建议', @@ -444,7 +445,7 @@ CREATE TABLE `bpm_task_ext` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 214 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程任务的拓展表'; +) ENGINE = InnoDB AUTO_INCREMENT = 295 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程任务的拓展表'; -- ---------------------------- -- Records of bpm_task_ext @@ -504,7 +505,7 @@ CREATE TABLE `infra_api_access_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 29228 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'API 访问日志表'; +) ENGINE = InnoDB AUTO_INCREMENT = 35150 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'API 访问日志表'; -- ---------------------------- -- Records of infra_api_access_log @@ -546,7 +547,7 @@ CREATE TABLE `infra_api_error_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 429 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; +) ENGINE = InnoDB AUTO_INCREMENT = 627 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; -- ---------------------------- -- Records of infra_api_error_log @@ -673,7 +674,7 @@ CREATE TABLE `infra_data_source_config` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据源配置表'; +) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据源配置表'; -- ---------------------------- -- Records of infra_data_source_config @@ -688,6 +689,7 @@ DROP TABLE IF EXISTS `infra_file`; CREATE TABLE `infra_file` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '文件编号', `config_id` bigint NULL DEFAULT NULL COMMENT '配置编号', + `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件名', `path` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件路径', `url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件 URL', `type` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件类型', @@ -698,7 +700,7 @@ CREATE TABLE `infra_file` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; +) ENGINE = InnoDB AUTO_INCREMENT = 85 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; -- ---------------------------- -- Records of infra_file @@ -723,7 +725,7 @@ CREATE TABLE `infra_file_config` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件配置表'; +) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件配置表'; -- ---------------------------- -- Records of infra_file_config @@ -732,6 +734,9 @@ BEGIN; INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '数据库', 1, '我是数据库', b'0', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.db.DBFileClientConfig\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2022-03-15 23:56:24', '1', '2022-03-26 21:39:26', b'0'); INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5, '本地磁盘', 10, '测试下本地存储', b'0', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig\",\"basePath\":\"/Users/yunai/file_test\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2022-03-15 23:57:00', '1', '2022-03-26 21:39:26', b'0'); INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (11, 'S3 - 七牛云', 20, NULL, b'1', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3-cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8\",\"accessSecret\":\"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP\"}', '1', '2022-03-19 18:00:03', '1', '2022-03-26 21:39:26', b'0'); +INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (15, 'S3 - 七牛云', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3-cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8\",\"accessSecret\":\"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP\"}', '1', '2022-06-10 20:50:41', '1', '2022-06-10 20:50:41', b'0'); +INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (16, 'S3 - 七牛云', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3-cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8\",\"accessSecret\":\"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP\"}', '1', '2022-06-11 20:32:08', '1', '2022-06-11 20:32:08', b'0'); +INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (17, 'S3 - 七牛云', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3-cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8\",\"accessSecret\":\"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP\"}', '1', '2022-06-11 20:32:47', '1', '2022-06-11 20:32:47', b'0'); COMMIT; -- ---------------------------- @@ -862,7 +867,7 @@ CREATE TABLE `member_user` ( `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号' -) ENGINE = InnoDB AUTO_INCREMENT = 247 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户'; +) ENGINE = InnoDB AUTO_INCREMENT = 248 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户'; -- ---------------------------- -- Records of member_user @@ -1153,11 +1158,11 @@ CREATE TABLE `system_dept` ( -- ---------------------------- BEGIN; INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, '芋道源码', 0, 0, 1, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '103', '2022-01-14 01:04:05', b'0', 1); -INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (101, '深圳总公司', 100, 1, 104, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2022-02-22 19:47:48', b'0', 1); +INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (101, '深圳总公司', 100, 1, 104, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2022-05-16 20:25:23', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (102, '长沙分公司', 100, 2, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '', '2021-12-15 05:01:40', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, '研发部门', 101, 1, 104, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '103', '2022-01-14 01:04:14', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, '市场部门', 101, 2, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '', '2021-12-15 05:01:38', b'0', 1); -INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (105, '测试部门', 101, 3, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '', '2021-12-15 05:01:37', b'0', 1); +INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (105, '测试部门', 101, 3, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2022-05-16 20:25:15', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (106, '财务部门', 101, 4, 103, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '103', '2022-01-15 21:32:22', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (107, '运维部门', 101, 5, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '', '2021-12-15 05:01:33', b'0', 1); INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`, `phone`, `email`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (108, '市场部门', 102, 1, NULL, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2022-02-16 08:35:45', b'0', 1); @@ -1186,7 +1191,7 @@ CREATE TABLE `system_dict_data` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1161 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; +) ENGINE = InnoDB AUTO_INCREMENT = 1162 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; -- ---------------------------- -- Records of system_dict_data @@ -1258,7 +1263,6 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (79, 2, '手动编辑', '2', 'system_error_code_type', 0, 'primary', '', NULL, '1', '2021-04-21 00:07:14', '1', '2022-02-16 13:57:24', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (80, 100, '账号登录', '100', 'system_login_type', 0, 'primary', '', '账号登录', '1', '2021-10-06 00:52:02', '1', '2022-02-16 13:11:34', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (81, 101, '社交登录', '101', 'system_login_type', 0, 'info', '', '社交登录', '1', '2021-10-06 00:52:17', '1', '2022-02-16 13:11:40', b'0'); -INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (82, 102, 'Mock 登录', '102', 'system_login_type', 0, 'danger', '', 'Mock 登录', '1', '2021-10-06 00:52:32', '1', '2022-02-16 13:11:44', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (83, 200, '主动登出', '200', 'system_login_type', 0, 'primary', '', '主动登出', '1', '2021-10-06 00:52:58', '1', '2022-02-16 13:11:49', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (85, 202, '强制登出', '202', 'system_login_type', 0, 'danger', '', '强制退出', '1', '2021-10-06 00:53:41', '1', '2022-02-16 13:11:57', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (86, 0, '病假', '1', 'bpm_oa_leave_type', 0, 'primary', '', NULL, '1', '2021-09-21 22:35:28', '1', '2022-02-16 10:00:41', b'0'); @@ -1346,13 +1350,13 @@ CREATE TABLE `system_dict_type` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; +) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; -- ---------------------------- -- Records of system_dict_type -- ---------------------------- BEGIN; -INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '用户性别', 'system_user_sex', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:30:31', b'0'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '用户性别', 'system_user_sex', 0, NULL, 'admin', '2021-01-05 17:03:48', '1', '2022-05-16 20:29:32', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6, '参数类型', 'infra_config_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:36:54', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (7, '通知类型', 'system_notice_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:35:26', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (9, '操作类型', 'system_operate_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 09:32:21', b'0'); @@ -1360,7 +1364,7 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (11, 'Boolean 是否类型', 'infra_boolean_string', 0, 'boolean 转是否', '', '2021-01-19 03:20:08', '', '2022-02-01 16:37:10', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (104, '登陆结果', 'system_login_result', 0, '登陆结果', '', '2021-01-18 06:17:11', '', '2022-02-01 16:36:00', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (105, 'Redis 超时类型', 'infra_redis_timeout_type', 0, 'RedisKeyDefine.TimeoutTypeEnum', '', '2021-01-26 00:52:50', '', '2022-02-01 16:50:29', b'0'); -INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (106, '代码生成模板类型', 'infra_codegen_template_type', 0, NULL, '', '2021-02-05 07:08:06', '', '2022-03-10 16:33:42', b'0'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (106, '代码生成模板类型', 'infra_codegen_template_type', 0, NULL, '', '2021-02-05 07:08:06', '1', '2022-05-16 20:26:50', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (107, '定时任务状态', 'infra_job_status', 0, NULL, '', '2021-02-07 07:44:16', '', '2022-02-01 16:51:11', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (108, '定时任务日志状态', 'infra_job_log_status', 0, NULL, '', '2021-02-08 10:03:51', '', '2022-02-01 16:50:43', b'0'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (109, '用户类型', 'user_type', 0, NULL, '', '2021-02-26 00:15:51', '', '2021-02-26 00:15:51', b'0'); @@ -1411,7 +1415,7 @@ CREATE TABLE `system_error_code` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5458 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表'; +) ENGINE = InnoDB AUTO_INCREMENT = 5832 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表'; -- ---------------------------- -- Records of system_error_code @@ -1440,7 +1444,7 @@ CREATE TABLE `system_login_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1341 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; +) ENGINE = InnoDB AUTO_INCREMENT = 1489 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; -- ---------------------------- -- Records of system_login_log @@ -1744,10 +1748,11 @@ DROP TABLE IF EXISTS `system_oauth2_access_token`; CREATE TABLE `system_oauth2_access_token` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `user_id` bigint NOT NULL COMMENT '用户编号', + `user_type` tinyint NOT NULL COMMENT '用户类型', `access_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '访问令牌', `refresh_token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '刷新令牌', - `user_type` tinyint NOT NULL COMMENT '用户类型', `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号', + `scopes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '授权范围', `expires_time` datetime NOT NULL COMMENT '过期时间', `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', @@ -1756,7 +1761,7 @@ CREATE TABLE `system_oauth2_access_token` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 56 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '刷新令牌'; +) ENGINE = InnoDB AUTO_INCREMENT = 231 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; -- ---------------------------- -- Records of system_oauth2_access_token @@ -1764,6 +1769,33 @@ CREATE TABLE `system_oauth2_access_token` ( BEGIN; COMMIT; +-- ---------------------------- +-- Table structure for system_oauth2_approve +-- ---------------------------- +DROP TABLE IF EXISTS `system_oauth2_approve`; +CREATE TABLE `system_oauth2_approve` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `user_id` bigint NOT NULL COMMENT '用户编号', + `user_type` tinyint NOT NULL COMMENT '用户类型', + `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号', + `scope` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '授权范围', + `approved` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否接受', + `expires_time` datetime NOT NULL COMMENT '过期时间', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 80 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 批准表'; + +-- ---------------------------- +-- Records of system_oauth2_approve +-- ---------------------------- +BEGIN; +COMMIT; + -- ---------------------------- -- Table structure for system_oauth2_client -- ---------------------------- @@ -1779,9 +1811,9 @@ CREATE TABLE `system_oauth2_client` ( `access_token_validity_seconds` int NOT NULL COMMENT '访问令牌的有效期', `refresh_token_validity_seconds` int NOT NULL COMMENT '刷新令牌的有效期', `redirect_uris` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '可重定向的 URI 地址', - `auto_approve` bit(1) NOT NULL COMMENT '是否自动授权', `authorized_grant_types` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '授权类型', `scopes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '授权范围', + `auto_approve_scopes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '自动通过的授权范围', `authorities` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '权限', `resource_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '资源', `additional_information` varchar(4096) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加信息', @@ -1797,8 +1829,37 @@ CREATE TABLE `system_oauth2_client` ( -- Records of system_oauth2_client -- ---------------------------- BEGIN; -INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `auto_approve`, `authorized_grant_types`, `scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', 0, 999999999, 8640, '[\"https://www.iocoder.cn\",\"https://doc.iocoder.cn\"]', b'1', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\"]', '[\"user_info\"]', '[\"system:user:query\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2022-05-12 01:00:20', b'0'); -INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `auto_approve`, `authorized_grant_types`, `scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (40, 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, 0, 1800, 43200, '[\"https://www.iocoder.cn\"]', b'1', '[\"password\",\"authorization_code\",\"implicit\"]', '[]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2022-05-12 00:59:53', b'0'); +INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', 0, 999999999, 8640, '[\"https://www.iocoder.cn\",\"https://doc.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[\"user.read\",\"user.write\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2022-05-23 13:33:11', b'0'); +INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (40, 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, 0, 1800, 43200, '[\"https://www.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\"]', '[\"user_info\",\"projects\"]', '[\"user_info\"]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2022-05-14 15:11:31', b'0'); +COMMIT; + +-- ---------------------------- +-- Table structure for system_oauth2_code +-- ---------------------------- +DROP TABLE IF EXISTS `system_oauth2_code`; +CREATE TABLE `system_oauth2_code` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `user_id` bigint NOT NULL COMMENT '用户编号', + `user_type` tinyint NOT NULL COMMENT '用户类型', + `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '授权码', + `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号', + `scopes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权范围', + `expires_time` datetime NOT NULL COMMENT '过期时间', + `redirect_uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '可重定向的 URI 地址', + `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '状态', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 授权码表'; + +-- ---------------------------- +-- Records of system_oauth2_code +-- ---------------------------- +BEGIN; COMMIT; -- ---------------------------- @@ -1811,6 +1872,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( `refresh_token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '刷新令牌', `user_type` tinyint NOT NULL COMMENT '用户类型', `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号', + `scopes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '授权范围', `expires_time` datetime NOT NULL COMMENT '过期时间', `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', @@ -1819,7 +1881,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '刷新令牌'; +) ENGINE = InnoDB AUTO_INCREMENT = 165 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '刷新令牌'; -- ---------------------------- -- Records of system_oauth2_refresh_token @@ -1859,7 +1921,7 @@ CREATE TABLE `system_operate_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2097 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; +) ENGINE = InnoDB AUTO_INCREMENT = 2432 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; -- ---------------------------- -- Records of system_operate_log @@ -1917,7 +1979,7 @@ CREATE TABLE `system_role` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 112 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色信息表'; +) ENGINE = InnoDB AUTO_INCREMENT = 114 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色信息表'; -- ---------------------------- -- Records of system_role @@ -1925,10 +1987,11 @@ CREATE TABLE `system_role` ( BEGIN; INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, '超级管理员', 'super_admin', 1, 1, '', 0, 1, '超级管理员', 'admin', '2021-01-05 17:03:48', '', '2022-02-22 05:08:21', b'0', 1); INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, '普通角色', 'common', 2, 2, '', 0, 1, '普通角色', 'admin', '2021-01-05 17:03:48', '', '2022-02-22 05:08:20', b'0', 1); -INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (101, '测试账号', 'test', 0, 1, '[]', 0, 2, '132', '', '2021-01-06 13:49:35', '1', '2022-04-01 21:37:13', b'0', 1); +INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (101, '测试账号', 'test', 0, 1, '[]', 0, 2, '132', '', '2021-01-06 13:49:35', '1', '2022-05-28 16:11:05', b'0', 1); INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (109, '租户管理员', 'tenant_admin', 0, 1, '', 0, 1, '系统自动生成', '1', '2022-02-22 00:56:14', '1', '2022-02-22 00:56:14', b'0', 121); INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (110, '测试角色', 'test', 0, 1, '[]', 0, 2, '嘿嘿', '110', '2022-02-23 00:14:34', '110', '2022-02-23 13:14:58', b'0', 121); INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (111, '租户管理员', 'tenant_admin', 0, 1, '', 0, 1, '系统自动生成', '1', '2022-03-07 21:37:58', '1', '2022-03-07 21:37:58', b'0', 122); +INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_scope_dept_ids`, `status`, `type`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (113, '租户管理员', 'tenant_admin', 0, 1, '', 0, 1, '系统自动生成', '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); COMMIT; -- ---------------------------- @@ -1946,7 +2009,7 @@ CREATE TABLE `system_role_menu` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1695 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表'; +) ENGINE = InnoDB AUTO_INCREMENT = 1729 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表'; -- ---------------------------- -- Records of system_role_menu @@ -2143,6 +2206,23 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1692, 101, 114, '1', '2022-04-01 22:21:37', '1', '2022-04-01 22:21:37', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1693, 101, 115, '1', '2022-04-01 22:21:37', '1', '2022-04-01 22:21:37', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1694, 101, 116, '1', '2022-04-01 22:21:37', '1', '2022-04-01 22:21:37', b'0', 1); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1712, 113, 1024, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1713, 113, 1025, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1714, 113, 1, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1715, 113, 102, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1716, 113, 103, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1717, 113, 104, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1718, 113, 1013, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1719, 113, 1014, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1720, 113, 1015, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1721, 113, 1016, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1722, 113, 1017, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1723, 113, 1018, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1724, 113, 1019, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1725, 113, 1020, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1726, 113, 1021, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1727, 113, 1022, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1728, 113, 1023, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); COMMIT; -- ---------------------------- @@ -2177,7 +2257,7 @@ COMMIT; DROP TABLE IF EXISTS `system_sms_channel`; CREATE TABLE `system_sms_channel` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', - `signature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '短信签名', + `signature` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '短信签名', `code` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '渠道编码', `status` tinyint NOT NULL COMMENT '开启状态', `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', @@ -2199,7 +2279,7 @@ BEGIN; INSERT INTO `system_sms_channel` (`id`, `signature`, `code`, `status`, `remark`, `api_key`, `api_secret`, `callback_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道', 'YUN_PIAN', 0, '呵呵呵哒', '1555a14277cb8a608cf45a9e6a80d510', NULL, 'http://vdwapu.natappfree.cc/admin-api/system/sms/callback/yunpian', '', '2021-03-31 06:12:20', '1', '2022-02-23 16:48:44', b'0'); INSERT INTO `system_sms_channel` (`id`, `signature`, `code`, `status`, `remark`, `api_key`, `api_secret`, `callback_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, 'Ballcat', 'ALIYUN', 0, '啦啦啦', 'LTAI5tCnKso2uG3kJ5gRav88', 'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, '', '2021-03-31 11:53:10', '1', '2021-04-14 00:08:37', b'0'); INSERT INTO `system_sms_channel` (`id`, `signature`, `code`, `status`, `remark`, `api_key`, `api_secret`, `callback_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '测试渠道', 'DEBUG_DING_TALK', 0, '123', '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', '2021-04-13 00:23:14', '1', '2022-03-27 20:29:49', b'0'); -INSERT INTO `system_sms_channel` (`id`, `signature`, `code`, `status`, `remark`, `api_key`, `api_secret`, `callback_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6, '测试演示', 'DEBUG_DING_TALK', 0, NULL, '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', '2022-04-10 23:07:59', '1', '2022-04-10 23:07:59', b'0'); +INSERT INTO `system_sms_channel` (`id`, `signature`, `code`, `status`, `remark`, `api_key`, `api_secret`, `callback_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6, '测试演示', 'DEBUG_DING_TALK', 0, NULL, '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', '2022-04-10 23:07:59', '1', '2022-05-16 20:34:49', b'0'); COMMIT; -- ---------------------------- @@ -2224,7 +2304,7 @@ CREATE TABLE `system_sms_code` ( `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号' -) ENGINE = InnoDB AUTO_INCREMENT = 467 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; +) ENGINE = InnoDB AUTO_INCREMENT = 469 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; -- ---------------------------- -- Records of system_sms_code @@ -2267,7 +2347,7 @@ CREATE TABLE `system_sms_log` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 140 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; +) ENGINE = InnoDB AUTO_INCREMENT = 242 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; -- ---------------------------- -- Records of system_sms_log @@ -2337,7 +2417,7 @@ CREATE TABLE `system_social_user` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表'; +) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表'; -- ---------------------------- -- Records of system_social_user @@ -2362,7 +2442,7 @@ CREATE TABLE `system_social_user_bind` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表'; +) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表'; -- ---------------------------- -- Records of system_social_user_bind @@ -2391,14 +2471,14 @@ CREATE TABLE `system_tenant` ( `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 123 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '租户表'; +) ENGINE = InnoDB AUTO_INCREMENT = 125 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '租户表'; -- ---------------------------- -- Records of system_tenant -- ---------------------------- BEGIN; INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'https://www.iocoder.cn', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2022-02-23 12:15:11', b'0'); -INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1', '2022-02-22 00:56:14', '1', '2022-03-19 18:37:20', b'0'); +INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1', '2022-02-22 00:56:14', '1', '2022-05-17 10:03:59', b'0'); INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2022-03-07 21:37:58', b'0'); COMMIT; @@ -2442,7 +2522,7 @@ CREATE TABLE `system_user_post` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 115 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户岗位表'; +) ENGINE = InnoDB AUTO_INCREMENT = 116 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户岗位表'; -- ---------------------------- -- Records of system_user_post @@ -2451,6 +2531,7 @@ BEGIN; INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (112, 1, 1, 'admin', '2022-05-02 07:25:24', 'admin', '2022-05-02 07:25:24', b'0', 1); INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (113, 100, 1, 'admin', '2022-05-02 07:25:24', 'admin', '2022-05-02 07:25:24', b'0', 1); INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (114, 114, 3, 'admin', '2022-05-02 07:25:24', 'admin', '2022-05-02 07:25:24', b'0', 1); +INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (115, 104, 1, '1', '2022-05-16 19:36:28', '1', '2022-05-16 19:36:28', b'0', 1); COMMIT; -- ---------------------------- @@ -2468,7 +2549,7 @@ CREATE TABLE `system_user_role` ( `deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户和角色关联表'; +) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户和角色关联表'; -- ---------------------------- -- Records of system_user_role @@ -2479,7 +2560,6 @@ INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_t INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 100, 101, '', '2022-01-11 13:19:45', '', '2022-05-12 12:35:13', b'0', 1); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 100, 1, '', '2022-01-11 13:19:45', '', '2022-05-12 12:35:12', b'0', 1); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6, 100, 2, '', '2022-01-11 13:19:45', '', '2022-05-12 12:35:11', b'0', 1); -INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 104, 101, '', '2022-01-11 13:19:45', '', '2022-05-12 12:35:11', b'0', 1); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 103, 1, '1', '2022-01-11 13:19:45', '1', '2022-01-11 13:19:45', b'0', 1); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (11, 107, 106, '1', '2022-02-20 22:59:33', '1', '2022-02-20 22:59:33', b'0', 118); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (12, 108, 107, '1', '2022-02-20 23:00:50', '1', '2022-02-20 23:00:50', b'0', 119); @@ -2489,6 +2569,8 @@ INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_t INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (16, 113, 111, '1', '2022-03-07 21:37:58', '1', '2022-03-07 21:37:58', b'0', 122); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (17, 114, 101, '1', '2022-03-19 21:51:13', '1', '2022-03-19 21:51:13', b'0', 1); INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (18, 1, 2, '1', '2022-05-12 20:39:29', '1', '2022-05-12 20:39:29', b'0', 1); +INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (19, 116, 113, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); +INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (20, 104, 101, '1', '2022-05-28 15:43:57', '1', '2022-05-28 15:43:57', b'0', 1); COMMIT; -- ---------------------------- @@ -2546,16 +2628,16 @@ CREATE TABLE `system_users` ( `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `idx_username`(`username` ASC, `update_time` ASC, `tenant_id` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 116 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表'; +) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表'; -- ---------------------------- -- Records of system_users -- ---------------------------- BEGIN; -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/48934f2f-92d4-4250-b917-d10d2b262c6a', 0, '127.0.0.1', '2022-05-13 00:12:13', 'admin', '2021-01-05 17:03:47', NULL, '2022-05-13 00:12:13', b'0', 1); -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '', NULL, '', '2021-01-07 09:07:17', '104', '2021-12-16 09:26:10', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/48934f2f-92d4-4250-b917-d10d2b262c6a', 0, '127.0.0.1', '2022-06-15 08:03:23', 'admin', '2021-01-05 17:03:47', NULL, '2022-06-15 08:03:23', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '127.0.0.1', '2022-05-22 19:35:33', '', '2021-01-07 09:07:17', NULL, '2022-05-22 19:35:33', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, 'yuanma', '$2a$10$wWoPT7sqriM2O1YXRL.je.GiL538OR6ZTN8aQZr9JAGdnpCH2tpYe', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '127.0.0.1', '2022-01-18 00:33:40', '', '2021-01-13 23:50:35', NULL, '2022-01-18 00:33:40', b'0', 1); -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$10$e5RpuDCC0GYSt0Hvd2.CjujIXwgGct4SnXi6dVGxdgFsnqgEryk5a', '测试号', NULL, 107, '[]', '111@qq.com', '15601691200', 1, '', 0, '127.0.0.1', '2022-03-19 21:46:19', '', '2021-01-21 02:13:53', NULL, '2022-03-19 21:46:19', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$10$GP8zvqHB//TekuzYZSBYAuBQJiNq1.fxQVDYJ.uBCOnWCtDVKE4H6', '测试号', NULL, 107, '[1]', '111@qq.com', '15601691200', 1, '', 0, '127.0.0.1', '2022-05-28 15:43:17', '', '2021-01-21 02:13:53', NULL, '2022-05-28 15:43:17', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (107, 'admin107', '$2a$10$dYOOBKMO93v/.ReCqzyFg.o67Tqk.bbc2bhrpyBGkIw9aypCtr2pm', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '', NULL, '1', '2022-02-20 22:59:33', '1', '2022-02-27 08:26:51', b'0', 118); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (108, 'admin108', '$2a$10$y6mfvKoNYL1GXWak8nYwVOH.kCWqjactkzdoIDgiKl93WN3Ejg.Lu', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '', NULL, '1', '2022-02-20 23:00:50', '1', '2022-02-27 08:26:53', b'0', 119); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (109, 'admin109', '$2a$10$JAqvH0tEc0I7dfDVBI7zyuB4E3j.uH6daIjV53.vUS6PknFkDJkuK', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '', NULL, '1', '2022-02-20 23:11:50', '1', '2022-02-27 08:26:56', b'0', 120); @@ -2564,7 +2646,8 @@ INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (112, 'newobject', '$2a$10$jh5MsR.ud/gKe3mVeUp5t.nEXGDSmHyv5OYjWQwHO8wlGmMSI9Twy', '新对象', NULL, NULL, '[]', '', '', 0, '', 0, '', NULL, '1', '2022-02-23 19:08:03', '1', '2022-02-23 19:08:03', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (113, 'aoteman', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '127.0.0.1', '2022-03-19 18:38:51', '1', '2022-03-07 21:37:58', NULL, '2022-03-19 18:38:51', b'0', 122); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (114, 'hrmgr', '$2a$10$TR4eybBioGRhBmDBWkqWLO6NIh3mzYa8KBKDDB5woiGYFVlRAi.fu', 'hr 小姐姐', NULL, NULL, '[3]', '', '', 0, '', 0, '127.0.0.1', '2022-03-19 22:15:43', '1', '2022-03-19 21:50:58', NULL, '2022-03-19 22:15:43', b'0', 1); -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (115, 'aotemane', '$2a$10$/WCwGHu1eq0wOVDd/u8HweJ0gJCHyLS6T7ndCqI8UXZAQom1etk2e', '1', '11', 100, '[]', '', '', 0, '', 0, '', NULL, '1', '2022-04-30 02:55:43', '1', '2022-04-30 02:55:43', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (115, 'aotemane', '$2a$10$/WCwGHu1eq0wOVDd/u8HweJ0gJCHyLS6T7ndCqI8UXZAQom1etk2e', '1', '11', 101, '[]', '', '', 1, '', 0, '', NULL, '1', '2022-04-30 02:55:43', '1', '2022-05-22 20:18:45', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (116, '15601691302', '$2a$10$L5C4S0U6adBWMvFv1Wwl4.DI/NwYS3WIfLj5Q.Naqr5II8CmqsDZ6', '小豆', NULL, NULL, NULL, '', '', 0, '', 0, '', NULL, '1', '2022-05-17 10:07:10', '1', '2022-05-17 10:07:10', b'0', 124); COMMIT; SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql/oracle/ruoyi-vue-pro.sql b/sql/oracle/ruoyi-vue-pro.sql index 7f61ce5e2..1f4908645 100644 --- a/sql/oracle/ruoyi-vue-pro.sql +++ b/sql/oracle/ruoyi-vue-pro.sql @@ -11,7 +11,7 @@ Target Server Version : 110200 File Encoding : 65001 - Date: 13/05/2022 09:43:12 + Date: 15/06/2022 08:20:08 */ @@ -38,8 +38,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -96,8 +96,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -159,8 +159,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -224,8 +224,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -284,8 +284,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -342,8 +342,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -400,8 +400,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -463,8 +463,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -543,8 +543,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -645,8 +645,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -718,8 +718,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -780,8 +780,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -839,8 +839,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -884,15 +884,16 @@ CREATE TABLE "INFRA_FILE" ( "CREATE_TIME" DATE NOT NULL, "UPDATER" NVARCHAR2(64), "UPDATE_TIME" DATE NOT NULL, - "DELETED" NUMBER(1,0) DEFAULT 0 + "DELETED" NUMBER(1,0) DEFAULT 0, + "NAME" NVARCHAR2(512) ) LOGGING NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -913,6 +914,7 @@ COMMENT ON COLUMN "INFRA_FILE"."CREATOR" IS '创建者'; COMMENT ON COLUMN "INFRA_FILE"."CREATE_TIME" IS '创建时间'; COMMENT ON COLUMN "INFRA_FILE"."UPDATER" IS '更新者'; COMMENT ON COLUMN "INFRA_FILE"."UPDATE_TIME" IS '更新时间'; +COMMENT ON COLUMN "INFRA_FILE"."NAME" IS '文件名'; COMMENT ON TABLE "INFRA_FILE" IS '文件表'; -- ---------------------------- @@ -943,8 +945,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -997,8 +999,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1051,8 +1053,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1111,8 +1113,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1167,8 +1169,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1224,8 +1226,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1282,8 +1284,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1339,8 +1341,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1396,8 +1398,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1449,8 +1451,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1508,8 +1510,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1587,8 +1589,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1663,8 +1665,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1740,8 +1742,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1805,8 +1807,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1838,8 +1840,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1873,8 +1875,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1917,8 +1919,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1957,8 +1959,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -1990,8 +1992,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2024,8 +2026,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2058,8 +2060,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2095,8 +2097,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2139,8 +2141,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2185,8 +2187,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2230,8 +2232,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2301,8 +2303,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2353,7 +2355,6 @@ INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "ST INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('79', '2', '手动编辑', '2', 'system_error_code_type', '0', 'primary', NULL, NULL, '1', TO_DATE('2021-04-21 00:07:14', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:57:24', 'SYYYY-MM-DD HH24:MI:SS'), '0'); INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('80', '100', '账号登录', '100', 'system_login_type', '0', 'primary', NULL, '账号登录', '1', TO_DATE('2021-10-06 00:52:02', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:11:34', 'SYYYY-MM-DD HH24:MI:SS'), '0'); INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('81', '101', '社交登录', '101', 'system_login_type', '0', 'info', NULL, '社交登录', '1', TO_DATE('2021-10-06 00:52:17', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:11:40', 'SYYYY-MM-DD HH24:MI:SS'), '0'); -INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('82', '102', 'Mock 登录', '102', 'system_login_type', '0', 'danger', NULL, 'Mock 登录', '1', TO_DATE('2021-10-06 00:52:32', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:11:44', 'SYYYY-MM-DD HH24:MI:SS'), '0'); INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('83', '200', '主动登出', '200', 'system_login_type', '0', 'primary', NULL, '主动登出', '1', TO_DATE('2021-10-06 00:52:58', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:11:49', 'SYYYY-MM-DD HH24:MI:SS'), '0'); INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('85', '202', '强制登出', '202', 'system_login_type', '0', 'danger', NULL, '强制退出', '1', TO_DATE('2021-10-06 00:53:41', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 13:11:57', 'SYYYY-MM-DD HH24:MI:SS'), '0'); INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('86', '0', '病假', '1', 'bpm_oa_leave_type', '0', 'primary', NULL, NULL, '1', TO_DATE('2021-09-21 22:35:28', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 10:00:41', 'SYYYY-MM-DD HH24:MI:SS'), '0'); @@ -2491,8 +2492,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2582,8 +2583,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2641,8 +2642,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2692,8 +2693,8 @@ CREATE TABLE "SYSTEM_MENU" ( "ICON" NVARCHAR2(100), "COMPONENT" NVARCHAR2(255), "STATUS" NUMBER(6,0) NOT NULL, - "VISIBLE" NVARCHAR2(4 BYTE) NOT NULL, - "KEEP_ALIVE" NVARCHAR2(4 BYTE) NOT NULL, + "VISIBLE" NVARCHAR2(4) NOT NULL, + "KEEP_ALIVE" NVARCHAR2(4) NOT NULL, "CREATOR" NVARCHAR2(64), "CREATE_TIME" DATE NOT NULL, "UPDATER" NVARCHAR2(64), @@ -2705,8 +2706,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -2994,8 +2995,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3042,15 +3043,16 @@ CREATE TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" ( "UPDATER" NVARCHAR2(64), "UPDATE_TIME" DATE NOT NULL, "DELETED" NUMBER(4,0) DEFAULT 0 NOT NULL, - "TENANT_ID" NUMBER(20,0) NOT NULL + "TENANT_ID" NUMBER(20,0) NOT NULL, + "SCOPES" NVARCHAR2(255) DEFAULT '' ) LOGGING NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3074,6 +3076,7 @@ COMMENT ON COLUMN "SYSTEM_OAUTH2_ACCESS_TOKEN"."UPDATER" IS '更新者'; COMMENT ON COLUMN "SYSTEM_OAUTH2_ACCESS_TOKEN"."UPDATE_TIME" IS '更新时间'; COMMENT ON COLUMN "SYSTEM_OAUTH2_ACCESS_TOKEN"."DELETED" IS '是否删除'; COMMENT ON COLUMN "SYSTEM_OAUTH2_ACCESS_TOKEN"."TENANT_ID" IS '租户编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_ACCESS_TOKEN"."SCOPES" IS '授权范围'; COMMENT ON TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" IS '刷新令牌'; -- ---------------------------- @@ -3082,6 +3085,65 @@ COMMENT ON TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" IS '刷新令牌'; COMMIT; COMMIT; +-- ---------------------------- +-- Table structure for SYSTEM_OAUTH2_APPROVE +-- ---------------------------- +DROP TABLE "SYSTEM_OAUTH2_APPROVE"; +CREATE TABLE "SYSTEM_OAUTH2_APPROVE" ( + "ID" NUMBER(20,0) NOT NULL, + "USER_ID" NUMBER(20,0) NOT NULL, + "USER_TYPE" NUMBER(4,0) NOT NULL, + "CLIENT_ID" NVARCHAR2(255) NOT NULL, + "SCOPE" NVARCHAR2(255) NOT NULL, + "APPROVED" VARCHAR2(1 BYTE) NOT NULL, + "EXPIRES_TIME" DATE NOT NULL, + "CREATOR" NVARCHAR2(64), + "CREATE_TIME" DATE NOT NULL, + "UPDATER" NVARCHAR2(64), + "UPDATE_TIME" DATE NOT NULL, + "DELETED" NUMBER(4,0) DEFAULT 0 NOT NULL, + "TENANT_ID" NUMBER(20,0) NOT NULL +) +LOGGING +NOCOMPRESS +PCTFREE 10 +INITRANS 1 +STORAGE ( + INITIAL 65536 + NEXT 1048576 + MINEXTENTS 1 + MAXEXTENTS 2147483645 + FREELISTS 1 + FREELIST GROUPS 1 + BUFFER_POOL DEFAULT +) +PARALLEL 1 +NOCACHE +DISABLE ROW MOVEMENT +; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."ID" IS '编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."USER_ID" IS '用户编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."USER_TYPE" IS '用户类型'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."CLIENT_ID" IS '客户端编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."SCOPE" IS '授权范围'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."APPROVED" IS '是否接受'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."EXPIRES_TIME" IS '过期时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."CREATOR" IS '创建者'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."CREATE_TIME" IS '创建时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."UPDATER" IS '更新者'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."UPDATE_TIME" IS '更新时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."DELETED" IS '是否删除'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_APPROVE"."TENANT_ID" IS '租户编号'; +COMMENT ON TABLE "SYSTEM_OAUTH2_APPROVE" IS 'OAuth2 批准表'; + +-- ---------------------------- +-- Records of SYSTEM_OAUTH2_APPROVE +-- ---------------------------- +INSERT INTO "SYSTEM_OAUTH2_APPROVE" ("ID", "USER_ID", "USER_TYPE", "CLIENT_ID", "SCOPE", "APPROVED", "EXPIRES_TIME", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "TENANT_ID") VALUES ('42', '1', '2', 'default', 'user.write', '1', TO_DATE('2022-06-25 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:35:06', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '0', '1'); +INSERT INTO "SYSTEM_OAUTH2_APPROVE" ("ID", "USER_ID", "USER_TYPE", "CLIENT_ID", "SCOPE", "APPROVED", "EXPIRES_TIME", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "TENANT_ID") VALUES ('43', '1', '2', 'default', 'user.read', '1', TO_DATE('2022-06-25 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:35:06', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '0', '1'); +COMMIT; +COMMIT; + -- ---------------------------- -- Table structure for SYSTEM_OAUTH2_CLIENT -- ---------------------------- @@ -3097,9 +3159,9 @@ CREATE TABLE "SYSTEM_OAUTH2_CLIENT" ( "ACCESS_TOKEN_VALIDITY_SECONDS" NUMBER(11,0) NOT NULL, "REFRESH_TOKEN_VALIDITY_SECONDS" NUMBER(11,0) NOT NULL, "REDIRECT_URIS" NVARCHAR2(255) NOT NULL, - "AUTO_APPROVE" VARCHAR2(1 BYTE) NOT NULL, + "AUTO_APPROVE_SCOPES" VARCHAR2(255 BYTE) DEFAULT '', "AUTHORIZED_GRANT_TYPES" NVARCHAR2(255) NOT NULL, - "SCOPES" NVARCHAR2(255), + "SCOPES" NVARCHAR2(255) DEFAULT '', "AUTHORITIES" NVARCHAR2(255), "RESOURCE_IDS" NVARCHAR2(255), "ADDITIONAL_INFORMATION" NCLOB, @@ -3114,8 +3176,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3136,7 +3198,7 @@ COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."STATUS" IS '状态'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."ACCESS_TOKEN_VALIDITY_SECONDS" IS '访问令牌的有效期'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."REFRESH_TOKEN_VALIDITY_SECONDS" IS '刷新令牌的有效期'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."REDIRECT_URIS" IS '可重定向的 URI 地址'; -COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."AUTO_APPROVE" IS '是否自动授权'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."AUTO_APPROVE_SCOPES" IS '自动通过的授权范围'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."AUTHORIZED_GRANT_TYPES" IS '授权类型'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."SCOPES" IS '授权范围'; COMMENT ON COLUMN "SYSTEM_OAUTH2_CLIENT"."AUTHORITIES" IS '权限'; @@ -3152,8 +3214,72 @@ COMMENT ON TABLE "SYSTEM_OAUTH2_CLIENT" IS 'OAuth2 客户端表'; -- ---------------------------- -- Records of SYSTEM_OAUTH2_CLIENT -- ---------------------------- -INSERT INTO "SYSTEM_OAUTH2_CLIENT" ("ID", "CLIENT_ID", "SECRET", "NAME", "LOGO", "DESCRIPTION", "STATUS", "ACCESS_TOKEN_VALIDITY_SECONDS", "REFRESH_TOKEN_VALIDITY_SECONDS", "REDIRECT_URIS", "AUTO_APPROVE", "AUTHORIZED_GRANT_TYPES", "SCOPES", "AUTHORITIES", "RESOURCE_IDS", "ADDITIONAL_INFORMATION", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', '0', '180', '8640', '["https://www.iocoder.cn","https://doc.iocoder.cn"]', '1', '["password","authorization_code","implicit","refresh_token"]', '["user_info"]', '["system:user:query"]', '[]', '{}', '1', TO_DATE('2022-05-11 21:47:12', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-12 01:00:20', 'SYYYY-MM-DD HH24:MI:SS'), '0'); -INSERT INTO "SYSTEM_OAUTH2_CLIENT" ("ID", "CLIENT_ID", "SECRET", "NAME", "LOGO", "DESCRIPTION", "STATUS", "ACCESS_TOKEN_VALIDITY_SECONDS", "REFRESH_TOKEN_VALIDITY_SECONDS", "REDIRECT_URIS", "AUTO_APPROVE", "AUTHORIZED_GRANT_TYPES", "SCOPES", "AUTHORITIES", "RESOURCE_IDS", "ADDITIONAL_INFORMATION", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('40', 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, '0', '999999999', '43200', '["https://www.iocoder.cn"]', '1', '["password","authorization_code","implicit"]', '[]', '[]', '[]', '{}', '1', TO_DATE('2022-05-12 00:28:20', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-13 09:41:21', 'SYYYY-MM-DD HH24:MI:SS'), '0'); +INSERT INTO "SYSTEM_OAUTH2_CLIENT" ("ID", "CLIENT_ID", "SECRET", "NAME", "LOGO", "DESCRIPTION", "STATUS", "ACCESS_TOKEN_VALIDITY_SECONDS", "REFRESH_TOKEN_VALIDITY_SECONDS", "REDIRECT_URIS", "AUTO_APPROVE_SCOPES", "AUTHORIZED_GRANT_TYPES", "SCOPES", "AUTHORITIES", "RESOURCE_IDS", "ADDITIONAL_INFORMATION", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', '0', '180', '8640', '["https://www.iocoder.cn","https://doc.iocoder.cn"]', NULL, '["password","authorization_code","implicit","refresh_token"]', '["user.read","user.write"]', '["system:user:query"]', '[]', '{}', '1', TO_DATE('2022-05-11 21:47:12', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-12 01:00:20', 'SYYYY-MM-DD HH24:MI:SS'), '0'); +INSERT INTO "SYSTEM_OAUTH2_CLIENT" ("ID", "CLIENT_ID", "SECRET", "NAME", "LOGO", "DESCRIPTION", "STATUS", "ACCESS_TOKEN_VALIDITY_SECONDS", "REFRESH_TOKEN_VALIDITY_SECONDS", "REDIRECT_URIS", "AUTO_APPROVE_SCOPES", "AUTHORIZED_GRANT_TYPES", "SCOPES", "AUTHORITIES", "RESOURCE_IDS", "ADDITIONAL_INFORMATION", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('40', 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, '0', '1800', '43200', '["https://www.iocoder.cn"]', '[]', '["password","authorization_code","implicit"]', '[]', '[]', '[]', '{}', '1', TO_DATE('2022-05-12 00:28:20', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:30:33', 'SYYYY-MM-DD HH24:MI:SS'), '0'); +COMMIT; +COMMIT; + +-- ---------------------------- +-- Table structure for SYSTEM_OAUTH2_CODE +-- ---------------------------- +DROP TABLE "SYSTEM_OAUTH2_CODE"; +CREATE TABLE "SYSTEM_OAUTH2_CODE" ( + "ID" NUMBER(20,0) NOT NULL, + "USER_ID" NUMBER(20,0) NOT NULL, + "USER_TYPE" NUMBER(4,0) NOT NULL, + "CODE" NVARCHAR2(32) NOT NULL, + "CLIENT_ID" NVARCHAR2(255) NOT NULL, + "SCOPES" NVARCHAR2(255), + "EXPIRES_TIME" DATE NOT NULL, + "REDIRECT_URI" NVARCHAR2(255), + "STATE" NVARCHAR2(255) DEFAULT '', + "CREATOR" NVARCHAR2(64), + "CREATE_TIME" DATE NOT NULL, + "UPDATER" NVARCHAR2(64), + "UPDATE_TIME" DATE NOT NULL, + "DELETED" NUMBER(4,0) DEFAULT 0 NOT NULL, + "TENANT_ID" NUMBER(20,0) NOT NULL +) +LOGGING +NOCOMPRESS +PCTFREE 10 +INITRANS 1 +STORAGE ( + INITIAL 65536 + NEXT 1048576 + MINEXTENTS 1 + MAXEXTENTS 2147483645 + FREELISTS 1 + FREELIST GROUPS 1 + BUFFER_POOL DEFAULT +) +PARALLEL 1 +NOCACHE +DISABLE ROW MOVEMENT +; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."ID" IS '编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."USER_ID" IS '用户编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."USER_TYPE" IS '用户类型'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."CODE" IS '授权码'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."CLIENT_ID" IS '客户端编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."SCOPES" IS '授权范围'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."EXPIRES_TIME" IS '过期时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."REDIRECT_URI" IS '可重定向的 URI 地址'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."STATE" IS '状态'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."CREATOR" IS '创建者'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."CREATE_TIME" IS '创建时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."UPDATER" IS '更新者'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."UPDATE_TIME" IS '更新时间'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."DELETED" IS '是否删除'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_CODE"."TENANT_ID" IS '租户编号'; +COMMENT ON TABLE "SYSTEM_OAUTH2_CODE" IS 'OAuth2 授权码表'; + +-- ---------------------------- +-- Records of SYSTEM_OAUTH2_CODE +-- ---------------------------- +INSERT INTO "SYSTEM_OAUTH2_CODE" ("ID", "USER_ID", "USER_TYPE", "CODE", "CLIENT_ID", "SCOPES", "EXPIRES_TIME", "REDIRECT_URI", "STATE", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "TENANT_ID") VALUES ('3', '1', '2', 'b882271c7082496e889e8e1a798f1ca2', 'default', '["user.write"]', TO_DATE('2022-05-26 00:41:41', 'SYYYY-MM-DD HH24:MI:SS'), 'https://www.iocoder.cn', NULL, '1', TO_DATE('2022-05-26 00:36:41', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:36:41', 'SYYYY-MM-DD HH24:MI:SS'), '0', '1'); +INSERT INTO "SYSTEM_OAUTH2_CODE" ("ID", "USER_ID", "USER_TYPE", "CODE", "CLIENT_ID", "SCOPES", "EXPIRES_TIME", "REDIRECT_URI", "STATE", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "TENANT_ID") VALUES ('4', '1', '2', '69f7969f221c41e8a5a7887daad9d14e', 'default', '["user.write","user.read"]', TO_DATE('2022-05-26 00:41:50', 'SYYYY-MM-DD HH24:MI:SS'), 'https://www.iocoder.cn', NULL, '1', TO_DATE('2022-05-26 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:36:50', 'SYYYY-MM-DD HH24:MI:SS'), '0', '1'); +INSERT INTO "SYSTEM_OAUTH2_CODE" ("ID", "USER_ID", "USER_TYPE", "CODE", "CLIENT_ID", "SCOPES", "EXPIRES_TIME", "REDIRECT_URI", "STATE", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "TENANT_ID") VALUES ('5', '1', '2', 'b624454a2fd1447f95849629cf3079a1', 'default', '["user.read","user.write"]', TO_DATE('2022-05-26 00:41:52', 'SYYYY-MM-DD HH24:MI:SS'), 'https://www.iocoder.cn', NULL, '1', TO_DATE('2022-05-26 00:36:52', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-26 00:36:52', 'SYYYY-MM-DD HH24:MI:SS'), '0', '1'); COMMIT; COMMIT; @@ -3172,16 +3298,17 @@ CREATE TABLE "SYSTEM_OAUTH2_REFRESH_TOKEN" ( "CREATE_TIME" DATE NOT NULL, "UPDATER" NVARCHAR2(64), "UPDATE_TIME" DATE NOT NULL, - "DELETED" NUMBER(4,0) DEFAULT 0 NOT NULL, - "TENANT_ID" NUMBER(20,0) NOT NULL + "DELETED" NUMBER DEFAULT 0 NOT NULL, + "TENANT_ID" NUMBER(20,0) NOT NULL, + "SCOPES" NVARCHAR2(255) DEFAULT '' ) LOGGING NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3204,6 +3331,7 @@ COMMENT ON COLUMN "SYSTEM_OAUTH2_REFRESH_TOKEN"."UPDATER" IS '更新者'; COMMENT ON COLUMN "SYSTEM_OAUTH2_REFRESH_TOKEN"."UPDATE_TIME" IS '更新时间'; COMMENT ON COLUMN "SYSTEM_OAUTH2_REFRESH_TOKEN"."DELETED" IS '是否删除'; COMMENT ON COLUMN "SYSTEM_OAUTH2_REFRESH_TOKEN"."TENANT_ID" IS '租户编号'; +COMMENT ON COLUMN "SYSTEM_OAUTH2_REFRESH_TOKEN"."SCOPES" IS '授权范围'; COMMENT ON TABLE "SYSTEM_OAUTH2_REFRESH_TOKEN" IS '刷新令牌'; -- ---------------------------- @@ -3249,8 +3377,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3318,8 +3446,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3380,8 +3508,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3441,8 +3569,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3631,8 +3759,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3669,7 +3797,7 @@ COMMIT; DROP TABLE "SYSTEM_SMS_CHANNEL"; CREATE TABLE "SYSTEM_SMS_CHANNEL" ( "ID" NUMBER(20,0) NOT NULL, - "SIGNATURE" NVARCHAR2(10), + "SIGNATURE" NVARCHAR2(12), "CODE" NVARCHAR2(63), "STATUS" NUMBER(4,0) NOT NULL, "REMARK" NVARCHAR2(255), @@ -3687,8 +3815,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3749,8 +3877,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3825,8 +3953,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3901,8 +4029,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -3974,8 +4102,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4037,8 +4165,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4096,8 +4224,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4158,8 +4286,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4232,8 +4360,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4284,8 +4412,8 @@ NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -4543,12 +4671,24 @@ CREATE SEQUENCE "SYSTEM_NOTICE_SEQ" MINVALUE 0 MAXVALUE 999999999999999999999999 DROP SEQUENCE "SYSTEM_OAUTH2_ACCESS_TOKEN_SEQ"; CREATE SEQUENCE "SYSTEM_OAUTH2_ACCESS_TOKEN_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20; +-- ---------------------------- +-- Sequence structure for SYSTEM_OAUTH2_APPROVE_SEQ +-- ---------------------------- +DROP SEQUENCE "SYSTEM_OAUTH2_APPROVE_SEQ"; +CREATE SEQUENCE "SYSTEM_OAUTH2_APPROVE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20; + -- ---------------------------- -- Sequence structure for SYSTEM_OAUTH2_CLIENT_SEQ -- ---------------------------- DROP SEQUENCE "SYSTEM_OAUTH2_CLIENT_SEQ"; CREATE SEQUENCE "SYSTEM_OAUTH2_CLIENT_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20; +-- ---------------------------- +-- Sequence structure for SYSTEM_OAUTH2_CODE_SEQ +-- ---------------------------- +DROP SEQUENCE "SYSTEM_OAUTH2_CODE_SEQ"; +CREATE SEQUENCE "SYSTEM_OAUTH2_CODE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20; + -- ---------------------------- -- Sequence structure for SYSTEM_OPERATE_LOG_SEQ -- ---------------------------- @@ -5261,8 +5401,8 @@ CREATE INDEX "IDX_QRTZ_FT_INST_JOB_REQ_RCVRY" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5270,7 +5410,7 @@ STORAGE ( BUFFER_POOL DEFAULT ); CREATE INDEX "IDX_QRTZ_FT_JG" - ON "QRTZ_FIRED_TRIGGERS" ("SCHED_NAME" ASC, "JOB_GROUP" ASC) LOCAL + ON "QRTZ_FIRED_TRIGGERS" ("SCHED_NAME" ASC, "JOB_GROUP" ASC) LOGGING ONLINE NOSORT @@ -5278,8 +5418,8 @@ CREATE INDEX "IDX_QRTZ_FT_JG" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5293,8 +5433,8 @@ CREATE INDEX "IDX_QRTZ_FT_J_G" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5302,14 +5442,15 @@ STORAGE ( BUFFER_POOL DEFAULT ); CREATE INDEX "IDX_QRTZ_FT_TG" - ON "QRTZ_FIRED_TRIGGERS" ("SCHED_NAME" ASC, "TRIGGER_GROUP" ASC) + ON "QRTZ_FIRED_TRIGGERS" ("SCHED_NAME" ASC, "TRIGGER_GROUP" ASC) LOCAL LOGGING + NOSORT VISIBLE PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5344,8 +5485,8 @@ CREATE INDEX "IDX_QRTZ_J_GRP" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5355,14 +5496,12 @@ STORAGE ( CREATE INDEX "IDX_QRTZ_J_REQ_RECOVERY" ON "QRTZ_JOB_DETAILS" ("SCHED_NAME" ASC, "REQUESTS_RECOVERY" ASC) LOCAL LOGGING - ONLINE - NOSORT VISIBLE PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5478,22 +5617,7 @@ ALTER TABLE "QRTZ_TRIGGERS" ADD CONSTRAINT "SYS_C008696" CHECK ("START_TIME" IS -- Indexes structure for table QRTZ_TRIGGERS -- ---------------------------- CREATE INDEX "IDX_QRTZ_T_C" - ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "CALENDAR_NAME" ASC) - LOGGING - VISIBLE -PCTFREE 10 -INITRANS 2 -STORAGE ( - INITIAL 65536 - NEXT 1048576 - MINEXTENTS 1 - MAXEXTENTS 2147483645 - FREELISTS 1 - FREELIST GROUPS 1 - BUFFER_POOL DEFAULT -); -CREATE INDEX "IDX_QRTZ_T_J" - ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "JOB_NAME" ASC, "JOB_GROUP" ASC) LOCAL + ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "CALENDAR_NAME" ASC) LOCAL LOGGING ONLINE NOSORT @@ -5501,8 +5625,23 @@ CREATE INDEX "IDX_QRTZ_T_J" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 + MINEXTENTS 1 + MAXEXTENTS 2147483645 + FREELISTS 1 + FREELIST GROUPS 1 + BUFFER_POOL DEFAULT +); +CREATE INDEX "IDX_QRTZ_T_J" + ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "JOB_NAME" ASC, "JOB_GROUP" ASC) + LOGGING + VISIBLE +PCTFREE 10 +INITRANS 2 +STORAGE ( + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5518,8 +5657,8 @@ CREATE INDEX "IDX_QRTZ_T_JG" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5533,8 +5672,8 @@ CREATE INDEX "IDX_QRTZ_T_NEXT_FIRE_TIME" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5542,14 +5681,14 @@ STORAGE ( BUFFER_POOL DEFAULT ); CREATE INDEX "IDX_QRTZ_T_NFT_ST" - ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "TRIGGER_STATE" ASC, "NEXT_FIRE_TIME" ASC) + ON "QRTZ_TRIGGERS" ("SCHED_NAME" ASC, "TRIGGER_STATE" ASC, "NEXT_FIRE_TIME" ASC) LOCAL LOGGING VISIBLE PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5565,8 +5704,8 @@ CREATE INDEX "IDX_QRTZ_T_NFT_ST_MISFIRE" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5580,8 +5719,8 @@ CREATE INDEX "IDX_QRTZ_T_STATE" PCTFREE 10 INITRANS 2 STORAGE ( - INITIAL 65536 - NEXT 1048576 + INITIAL 65536 + NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 @@ -5724,6 +5863,21 @@ ALTER TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" ADD CONSTRAINT "SYS_C008426" CHECK ("UP ALTER TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" ADD CONSTRAINT "SYS_C008427" CHECK ("DELETED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_ACCESS_TOKEN" ADD CONSTRAINT "SYS_C008428" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +-- ---------------------------- +-- Checks structure for table SYSTEM_OAUTH2_APPROVE +-- ---------------------------- +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009679" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009691" CHECK ("USER_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009692" CHECK ("USER_TYPE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009693" CHECK ("CLIENT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009694" CHECK ("SCOPE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009695" CHECK ("APPROVED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009696" CHECK ("EXPIRES_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009697" CHECK ("CREATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009698" CHECK ("UPDATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009699" CHECK ("DELETED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_APPROVE" ADD CONSTRAINT "SYS_C009700" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; + -- ---------------------------- -- Primary Key structure for table SYSTEM_OAUTH2_CLIENT -- ---------------------------- @@ -5741,12 +5895,25 @@ ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008434" CHECK ("STATUS" ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008435" CHECK ("ACCESS_TOKEN_VALIDITY_SECONDS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008436" CHECK ("REFRESH_TOKEN_VALIDITY_SECONDS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008437" CHECK ("REDIRECT_URIS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; -ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008438" CHECK ("AUTO_APPROVE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008439" CHECK ("AUTHORIZED_GRANT_TYPES" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008440" CHECK ("CREATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008441" CHECK ("UPDATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; ALTER TABLE "SYSTEM_OAUTH2_CLIENT" ADD CONSTRAINT "SYS_C008442" CHECK ("DELETED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +-- ---------------------------- +-- Checks structure for table SYSTEM_OAUTH2_CODE +-- ---------------------------- +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009680" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009681" CHECK ("USER_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009682" CHECK ("USER_TYPE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009683" CHECK ("CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009684" CHECK ("CLIENT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009685" CHECK ("EXPIRES_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009687" CHECK ("CREATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009688" CHECK ("UPDATE_TIME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009689" CHECK ("DELETED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; +ALTER TABLE "SYSTEM_OAUTH2_CODE" ADD CONSTRAINT "SYS_C009690" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE; + -- ---------------------------- -- Primary Key structure for table SYSTEM_OAUTH2_REFRESH_TOKEN -- ---------------------------- diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index 5c75b7f18..9e80ce70d 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -12,7 +12,7 @@ Target Server Version : 140002 File Encoding : 65001 - Date: 13/05/2022 01:06:02 + Date: 15/06/2022 08:13:44 */ @@ -20,7 +20,7 @@ -- Sequence structure for act_evt_log_log_nr__seq -- ---------------------------- DROP SEQUENCE IF EXISTS "act_evt_log_log_nr__seq"; -CREATE SEQUENCE "act_evt_log_log_nr__seq" +CREATE SEQUENCE "act_evt_log_log_nr__seq" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 @@ -31,7 +31,7 @@ CACHE 1; -- Sequence structure for act_hi_tsk_log_id__seq -- ---------------------------- DROP SEQUENCE IF EXISTS "act_hi_tsk_log_id__seq"; -CREATE SEQUENCE "act_hi_tsk_log_id__seq" +CREATE SEQUENCE "act_hi_tsk_log_id__seq" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 @@ -42,7 +42,7 @@ CACHE 1; -- Sequence structure for bpm_form_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_form_seq"; -CREATE SEQUENCE "bpm_form_seq" +CREATE SEQUENCE "bpm_form_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -51,7 +51,7 @@ CACHE 1; -- Sequence structure for bpm_oa_leave_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_oa_leave_seq"; -CREATE SEQUENCE "bpm_oa_leave_seq" +CREATE SEQUENCE "bpm_oa_leave_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -60,7 +60,7 @@ CACHE 1; -- Sequence structure for bpm_process_definition_ext_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_process_definition_ext_seq"; -CREATE SEQUENCE "bpm_process_definition_ext_seq" +CREATE SEQUENCE "bpm_process_definition_ext_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -69,7 +69,7 @@ CACHE 1; -- Sequence structure for bpm_process_instance_ext_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_process_instance_ext_seq"; -CREATE SEQUENCE "bpm_process_instance_ext_seq" +CREATE SEQUENCE "bpm_process_instance_ext_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -78,7 +78,7 @@ CACHE 1; -- Sequence structure for bpm_task_assign_rule_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_task_assign_rule_seq"; -CREATE SEQUENCE "bpm_task_assign_rule_seq" +CREATE SEQUENCE "bpm_task_assign_rule_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -87,7 +87,7 @@ CACHE 1; -- Sequence structure for bpm_task_ext_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_task_ext_seq"; -CREATE SEQUENCE "bpm_task_ext_seq" +CREATE SEQUENCE "bpm_task_ext_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -96,7 +96,7 @@ CACHE 1; -- Sequence structure for bpm_user_group_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "bpm_user_group_seq"; -CREATE SEQUENCE "bpm_user_group_seq" +CREATE SEQUENCE "bpm_user_group_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -105,7 +105,7 @@ CACHE 1; -- Sequence structure for infra_api_access_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_api_access_log_seq"; -CREATE SEQUENCE "infra_api_access_log_seq" +CREATE SEQUENCE "infra_api_access_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -114,7 +114,7 @@ CACHE 1; -- Sequence structure for infra_api_error_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_api_error_log_seq"; -CREATE SEQUENCE "infra_api_error_log_seq" +CREATE SEQUENCE "infra_api_error_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -123,7 +123,7 @@ CACHE 1; -- Sequence structure for infra_codegen_column_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_codegen_column_seq"; -CREATE SEQUENCE "infra_codegen_column_seq" +CREATE SEQUENCE "infra_codegen_column_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -132,7 +132,7 @@ CACHE 1; -- Sequence structure for infra_codegen_table_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_codegen_table_seq"; -CREATE SEQUENCE "infra_codegen_table_seq" +CREATE SEQUENCE "infra_codegen_table_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -141,7 +141,7 @@ CACHE 1; -- Sequence structure for infra_config_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_config_seq"; -CREATE SEQUENCE "infra_config_seq" +CREATE SEQUENCE "infra_config_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -150,7 +150,7 @@ CACHE 1; -- Sequence structure for infra_data_source_config_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_data_source_config_seq"; -CREATE SEQUENCE "infra_data_source_config_seq" +CREATE SEQUENCE "infra_data_source_config_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -159,7 +159,7 @@ CACHE 1; -- Sequence structure for infra_file_config_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_file_config_seq"; -CREATE SEQUENCE "infra_file_config_seq" +CREATE SEQUENCE "infra_file_config_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -168,7 +168,7 @@ CACHE 1; -- Sequence structure for infra_file_content_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_file_content_seq"; -CREATE SEQUENCE "infra_file_content_seq" +CREATE SEQUENCE "infra_file_content_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -177,7 +177,7 @@ CACHE 1; -- Sequence structure for infra_file_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_file_seq"; -CREATE SEQUENCE "infra_file_seq" +CREATE SEQUENCE "infra_file_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -186,7 +186,7 @@ CACHE 1; -- Sequence structure for infra_job_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_job_log_seq"; -CREATE SEQUENCE "infra_job_log_seq" +CREATE SEQUENCE "infra_job_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -195,7 +195,7 @@ CACHE 1; -- Sequence structure for infra_job_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_job_seq"; -CREATE SEQUENCE "infra_job_seq" +CREATE SEQUENCE "infra_job_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -204,7 +204,7 @@ CACHE 1; -- Sequence structure for infra_test_demo_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "infra_test_demo_seq"; -CREATE SEQUENCE "infra_test_demo_seq" +CREATE SEQUENCE "infra_test_demo_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -213,7 +213,7 @@ CACHE 1; -- Sequence structure for member_user_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "member_user_seq"; -CREATE SEQUENCE "member_user_seq" +CREATE SEQUENCE "member_user_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -222,7 +222,7 @@ CACHE 1; -- Sequence structure for pay_app_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_app_seq"; -CREATE SEQUENCE "pay_app_seq" +CREATE SEQUENCE "pay_app_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -231,7 +231,7 @@ CACHE 1; -- Sequence structure for pay_channel_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_channel_seq"; -CREATE SEQUENCE "pay_channel_seq" +CREATE SEQUENCE "pay_channel_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -240,7 +240,7 @@ CACHE 1; -- Sequence structure for pay_merchant_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_merchant_seq"; -CREATE SEQUENCE "pay_merchant_seq" +CREATE SEQUENCE "pay_merchant_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -249,7 +249,7 @@ CACHE 1; -- Sequence structure for pay_notify_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_notify_log_seq"; -CREATE SEQUENCE "pay_notify_log_seq" +CREATE SEQUENCE "pay_notify_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -258,7 +258,7 @@ CACHE 1; -- Sequence structure for pay_notify_task_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_notify_task_seq"; -CREATE SEQUENCE "pay_notify_task_seq" +CREATE SEQUENCE "pay_notify_task_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -267,7 +267,7 @@ CACHE 1; -- Sequence structure for pay_order_extension_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_order_extension_seq"; -CREATE SEQUENCE "pay_order_extension_seq" +CREATE SEQUENCE "pay_order_extension_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -276,7 +276,7 @@ CACHE 1; -- Sequence structure for pay_order_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_order_seq"; -CREATE SEQUENCE "pay_order_seq" +CREATE SEQUENCE "pay_order_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -285,7 +285,7 @@ CACHE 1; -- Sequence structure for pay_refund_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "pay_refund_seq"; -CREATE SEQUENCE "pay_refund_seq" +CREATE SEQUENCE "pay_refund_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -294,7 +294,7 @@ CACHE 1; -- Sequence structure for system_dept_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_dept_seq"; -CREATE SEQUENCE "system_dept_seq" +CREATE SEQUENCE "system_dept_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -303,7 +303,7 @@ CACHE 1; -- Sequence structure for system_dict_data_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_dict_data_seq"; -CREATE SEQUENCE "system_dict_data_seq" +CREATE SEQUENCE "system_dict_data_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -312,7 +312,7 @@ CACHE 1; -- Sequence structure for system_dict_type_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_dict_type_seq"; -CREATE SEQUENCE "system_dict_type_seq" +CREATE SEQUENCE "system_dict_type_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -321,7 +321,7 @@ CACHE 1; -- Sequence structure for system_error_code_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_error_code_seq"; -CREATE SEQUENCE "system_error_code_seq" +CREATE SEQUENCE "system_error_code_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -330,7 +330,7 @@ CACHE 1; -- Sequence structure for system_login_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_login_log_seq"; -CREATE SEQUENCE "system_login_log_seq" +CREATE SEQUENCE "system_login_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -339,7 +339,7 @@ CACHE 1; -- Sequence structure for system_menu_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_menu_seq"; -CREATE SEQUENCE "system_menu_seq" +CREATE SEQUENCE "system_menu_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -348,7 +348,7 @@ CACHE 1; -- Sequence structure for system_notice_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_notice_seq"; -CREATE SEQUENCE "system_notice_seq" +CREATE SEQUENCE "system_notice_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -357,7 +357,7 @@ CACHE 1; -- Sequence structure for system_oauth2_access_token_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_oauth2_access_token_seq"; -CREATE SEQUENCE "system_oauth2_access_token_seq" +CREATE SEQUENCE "system_oauth2_access_token_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 @@ -368,7 +368,7 @@ CACHE 1; -- Sequence structure for system_oauth2_client_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_oauth2_client_seq"; -CREATE SEQUENCE "system_oauth2_client_seq" +CREATE SEQUENCE "system_oauth2_client_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 @@ -379,7 +379,7 @@ CACHE 1; -- Sequence structure for system_oauth2_refresh_token_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_oauth2_refresh_token_seq"; -CREATE SEQUENCE "system_oauth2_refresh_token_seq" +CREATE SEQUENCE "system_oauth2_refresh_token_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 @@ -390,7 +390,7 @@ CACHE 1; -- Sequence structure for system_operate_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_operate_log_seq"; -CREATE SEQUENCE "system_operate_log_seq" +CREATE SEQUENCE "system_operate_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -399,7 +399,7 @@ CACHE 1; -- Sequence structure for system_post_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_post_seq"; -CREATE SEQUENCE "system_post_seq" +CREATE SEQUENCE "system_post_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -408,7 +408,7 @@ CACHE 1; -- Sequence structure for system_role_menu_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_role_menu_seq"; -CREATE SEQUENCE "system_role_menu_seq" +CREATE SEQUENCE "system_role_menu_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -417,7 +417,7 @@ CACHE 1; -- Sequence structure for system_role_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_role_seq"; -CREATE SEQUENCE "system_role_seq" +CREATE SEQUENCE "system_role_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -426,7 +426,7 @@ CACHE 1; -- Sequence structure for system_sensitive_word_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_sensitive_word_seq"; -CREATE SEQUENCE "system_sensitive_word_seq" +CREATE SEQUENCE "system_sensitive_word_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -435,7 +435,7 @@ CACHE 1; -- Sequence structure for system_sms_channel_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_sms_channel_seq"; -CREATE SEQUENCE "system_sms_channel_seq" +CREATE SEQUENCE "system_sms_channel_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -444,7 +444,7 @@ CACHE 1; -- Sequence structure for system_sms_code_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_sms_code_seq"; -CREATE SEQUENCE "system_sms_code_seq" +CREATE SEQUENCE "system_sms_code_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -453,7 +453,7 @@ CACHE 1; -- Sequence structure for system_sms_log_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_sms_log_seq"; -CREATE SEQUENCE "system_sms_log_seq" +CREATE SEQUENCE "system_sms_log_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -462,7 +462,7 @@ CACHE 1; -- Sequence structure for system_sms_template_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_sms_template_seq"; -CREATE SEQUENCE "system_sms_template_seq" +CREATE SEQUENCE "system_sms_template_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -471,7 +471,7 @@ CACHE 1; -- Sequence structure for system_social_user_bind_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_social_user_bind_seq"; -CREATE SEQUENCE "system_social_user_bind_seq" +CREATE SEQUENCE "system_social_user_bind_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -480,7 +480,7 @@ CACHE 1; -- Sequence structure for system_social_user_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_social_user_seq"; -CREATE SEQUENCE "system_social_user_seq" +CREATE SEQUENCE "system_social_user_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -489,7 +489,7 @@ CACHE 1; -- Sequence structure for system_tenant_package_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_tenant_package_seq"; -CREATE SEQUENCE "system_tenant_package_seq" +CREATE SEQUENCE "system_tenant_package_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -498,7 +498,7 @@ CACHE 1; -- Sequence structure for system_tenant_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_tenant_seq"; -CREATE SEQUENCE "system_tenant_seq" +CREATE SEQUENCE "system_tenant_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -507,7 +507,7 @@ CACHE 1; -- Sequence structure for system_user_post_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_user_post_seq"; -CREATE SEQUENCE "system_user_post_seq" +CREATE SEQUENCE "system_user_post_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -516,7 +516,7 @@ CACHE 1; -- Sequence structure for system_user_role_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_user_role_seq"; -CREATE SEQUENCE "system_user_role_seq" +CREATE SEQUENCE "system_user_role_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; @@ -525,37 +525,11 @@ CACHE 1; -- Sequence structure for system_user_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "system_user_seq"; -CREATE SEQUENCE "system_user_seq" +CREATE SEQUENCE "system_user_seq" INCREMENT 1 MAXVALUE 9223372036854775807 CACHE 1; --- ---------------------------- --- Table structure for act_evt_log --- ---------------------------- -DROP TABLE IF EXISTS "act_evt_log"; -CREATE TABLE "act_evt_log" ( - "log_nr_" int4 NOT NULL DEFAULT nextval('act_evt_log_log_nr__seq'::regclass), - "type_" varchar(64) COLLATE "pg_catalog"."default", - "proc_def_id_" varchar(64) COLLATE "pg_catalog"."default", - "proc_inst_id_" varchar(64) COLLATE "pg_catalog"."default", - "execution_id_" varchar(64) COLLATE "pg_catalog"."default", - "task_id_" varchar(64) COLLATE "pg_catalog"."default", - "time_stamp_" timestamp(6) NOT NULL, - "user_id_" varchar(255) COLLATE "pg_catalog"."default", - "data_" bytea, - "lock_owner_" varchar(255) COLLATE "pg_catalog"."default", - "lock_time_" timestamp(6), - "is_processed_" int2 DEFAULT 0 -) -; - --- ---------------------------- --- Records of act_evt_log --- ---------------------------- -BEGIN; -COMMIT; - -- ---------------------------- -- Table structure for bpm_form -- ---------------------------- @@ -1548,19 +1522,19 @@ CREATE TABLE "infra_codegen_column" ( "column_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL, "data_type" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, "column_comment" varchar(500) COLLATE "pg_catalog"."default" NOT NULL, - "nullable" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, - "primary_key" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, - "auto_increment" char(1) COLLATE "pg_catalog"."default" NOT NULL, + "nullable" bool NOT NULL, + "primary_key" bool NOT NULL, + "auto_increment" bool NOT NULL, "ordinal_position" int4 NOT NULL, "java_type" varchar(32) COLLATE "pg_catalog"."default" NOT NULL, "java_field" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, "dict_type" varchar(200) COLLATE "pg_catalog"."default", - "example" varchar(64) COLLATE "pg_catalog"."default", - "create_operation" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, - "update_operation" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, - "list_operation" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, + "example" varchar(255) COLLATE "pg_catalog"."default", + "create_operation" bool NOT NULL, + "update_operation" bool NOT NULL, + "list_operation" bool NOT NULL, "list_operation_condition" varchar(32) COLLATE "pg_catalog"."default" NOT NULL, - "list_operation_result" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, + "list_operation_result" bool NOT NULL, "html_type" varchar(32) COLLATE "pg_catalog"."default" NOT NULL, "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, @@ -1663,7 +1637,7 @@ CREATE TABLE "infra_config" ( "name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, "config_key" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, "value" varchar(500) COLLATE "pg_catalog"."default" NOT NULL, - "visible" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, + "visible" varchar(5) COLLATE "pg_catalog"."default" NOT NULL, "remark" varchar(500) COLLATE "pg_catalog"."default", "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, @@ -1749,7 +1723,8 @@ CREATE TABLE "infra_file" ( "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, - "deleted" int2 NOT NULL DEFAULT 0 + "deleted" int2 NOT NULL DEFAULT 0, + "name" varchar(255) COLLATE "pg_catalog"."default" ) ; COMMENT ON COLUMN "infra_file"."id" IS '文件编号'; @@ -1763,6 +1738,7 @@ COMMENT ON COLUMN "infra_file"."create_time" IS '创建时间'; COMMENT ON COLUMN "infra_file"."updater" IS '更新者'; COMMENT ON COLUMN "infra_file"."update_time" IS '更新时间'; COMMENT ON COLUMN "infra_file"."deleted" IS '是否删除'; +COMMENT ON COLUMN "infra_file"."name" IS '文件名'; COMMENT ON TABLE "infra_file" IS '文件表'; -- ---------------------------- @@ -1780,7 +1756,7 @@ CREATE TABLE "infra_file_config" ( "name" varchar(63) COLLATE "pg_catalog"."default" NOT NULL, "storage" int2 NOT NULL, "remark" varchar(255) COLLATE "pg_catalog"."default", - "master" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, + "master" bool NOT NULL, "config" varchar(4096) COLLATE "pg_catalog"."default" NOT NULL, "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, @@ -1806,9 +1782,9 @@ COMMENT ON TABLE "infra_file_config" IS '文件配置表'; -- Records of infra_file_config -- ---------------------------- BEGIN; -INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (4, '数据库', 1, '我是数据库', '0', '{"@class":"cn.iocoder.yudao.framework.file.core.client.db.DBFileClientConfig","domain":"http://127.0.0.1:48080"}', '1', '2022-03-15 23:56:24', '1', '2022-03-26 21:39:26', 0); -INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (5, '本地磁盘', 10, '测试下本地存储', '0', '{"@class":"cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig","basePath":"/Users/yunai/file_test","domain":"http://127.0.0.1:48080"}', '1', '2022-03-15 23:57:00', '1', '2022-03-26 21:39:26', 0); -INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (11, 'S3 - 七牛云', 20, NULL, '1', '{"@class":"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig","endpoint":"s3-cn-south-1.qiniucs.com","domain":"http://test.yudao.iocoder.cn","bucket":"ruoyi-vue-pro","accessKey":"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8","accessSecret":"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP"}', '1', '2022-03-19 18:00:03', '1', '2022-03-26 21:39:26', 0); +INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (4, '数据库', 1, '我是数据库', 'f', '{"@class":"cn.iocoder.yudao.framework.file.core.client.db.DBFileClientConfig","domain":"http://127.0.0.1:48080"}', '1', '2022-03-15 23:56:24', '1', '2022-03-26 21:39:26', 0); +INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (5, '本地磁盘', 10, '测试下本地存储', 'f', '{"@class":"cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig","basePath":"/Users/yunai/file_test","domain":"http://127.0.0.1:48080"}', '1', '2022-03-15 23:57:00', '1', '2022-03-26 21:39:26', 0); +INSERT INTO "infra_file_config" ("id", "name", "storage", "remark", "master", "config", "creator", "create_time", "updater", "update_time", "deleted") VALUES (11, 'S3 - 七牛云', 20, NULL, 't', '{"@class":"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig","endpoint":"s3-cn-south-1.qiniucs.com","domain":"http://test.yudao.iocoder.cn","bucket":"ruoyi-vue-pro","accessKey":"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8","accessSecret":"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP"}', '1', '2022-03-19 18:00:03', '1', '2022-05-26 00:03:47.17', 0); COMMIT; -- ---------------------------- @@ -2827,7 +2803,6 @@ INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "st INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (79, 2, '手动编辑', '2', 'system_error_code_type', 0, 'primary', '', NULL, '1', '2021-04-21 00:07:14', '1', '2022-02-16 13:57:24', 0); INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (80, 100, '账号登录', '100', 'system_login_type', 0, 'primary', '', '账号登录', '1', '2021-10-06 00:52:02', '1', '2022-02-16 13:11:34', 0); INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (81, 101, '社交登录', '101', 'system_login_type', 0, 'info', '', '社交登录', '1', '2021-10-06 00:52:17', '1', '2022-02-16 13:11:40', 0); -INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (82, 102, 'Mock 登录', '102', 'system_login_type', 0, 'danger', '', 'Mock 登录', '1', '2021-10-06 00:52:32', '1', '2022-02-16 13:11:44', 0); INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (83, 200, '主动登出', '200', 'system_login_type', 0, 'primary', '', '主动登出', '1', '2021-10-06 00:52:58', '1', '2022-02-16 13:11:49', 0); INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (85, 202, '强制登出', '202', 'system_login_type', 0, 'danger', '', '强制退出', '1', '2021-10-06 00:53:41', '1', '2022-02-16 13:11:57', 0); INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (86, 0, '病假', '1', 'bpm_oa_leave_type', 0, 'primary', '', NULL, '1', '2021-09-21 22:35:28', '1', '2022-02-16 10:00:41', 0); @@ -3070,8 +3045,8 @@ CREATE TABLE "system_menu" ( "icon" varchar(100) COLLATE "pg_catalog"."default", "component" varchar(255) COLLATE "pg_catalog"."default", "status" int2 NOT NULL, - "visible" varchar(4) COLLATE "pg_catalog"."default" NOT NULL, - "keep_alive" varchar(4) COLLATE "pg_catalog"."default" NOT NULL, + "visible" bool NOT NULL, + "keep_alive" bool NOT NULL, "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", @@ -3102,236 +3077,236 @@ COMMENT ON TABLE "system_menu" IS '菜单权限表'; -- Records of system_menu -- ---------------------------- BEGIN; -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (2, '基础设施', '', 1, 20, 0, '/infra', 'monitor', NULL, 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (5, 'OA 示例', '', 1, 40, 1185, 'oa', 'people', NULL, 0, '1', '1', 'admin', '2021-09-20 16:26:19', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'user', 'system/user/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'peoples', 'system/role/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'tree-table', 'system/menu/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (103, '部门管理', '', 2, 4, 1, 'dept', 'tree', 'system/dept/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (104, '岗位管理', '', 2, 5, 1, 'post', 'post', 'system/post/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (105, '字典管理', '', 2, 6, 1, 'dict', 'dict', 'system/dict/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (106, '配置管理', '', 2, 6, 2, 'config', 'edit', 'infra/config/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (107, '通知公告', '', 2, 8, 1, 'notice', 'message', 'system/notice/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (108, '审计日志', '', 1, 9, 1, 'log', 'log', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (109, '令牌管理', '', 2, 2, 1261, 'token', 'online', 'system/oauth2/token/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-05-11 23:31:42', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (110, '定时任务', '', 2, 12, 2, 'job', 'job', 'infra/job/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (111, 'MySQL 监控', '', 2, 9, 2, 'druid', 'druid', 'infra/druid/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (112, 'Java 监控', '', 2, 11, 2, 'admin-server', 'server', 'infra/server/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (113, 'Redis 监控', '', 2, 10, 2, 'redis', 'redis', 'infra/redis/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (114, '表单构建', 'infra:build:list', 2, 2, 2, 'build', 'build', 'infra/build/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (115, '代码生成', 'infra:codegen:query', 2, 1, 2, 'codegen', 'code', 'infra/codegen/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (116, '系统接口', 'infra:swagger:list', 2, 3, 2, 'swagger', 'swagger', 'infra/swagger/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (500, '操作日志', '', 2, 1, 108, 'operate-log', 'form', 'system/operatelog/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (501, '登录日志', '', 2, 2, 108, 'login-log', 'logininfor', 'system/loginlog/index', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1001, '用户查询', 'system:user:query', 3, 1, 100, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1002, '用户新增', 'system:user:create', 3, 2, 100, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1003, '用户修改', 'system:user:update', 3, 3, 100, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1004, '用户删除', 'system:user:delete', 3, 4, 100, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1005, '用户导出', 'system:user:export', 3, 5, 100, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1006, '用户导入', 'system:user:import', 3, 6, 100, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1007, '重置密码', 'system:user:update-password', 3, 7, 100, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1008, '角色查询', 'system:role:query', 3, 1, 101, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1009, '角色新增', 'system:role:create', 3, 2, 101, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1010, '角色修改', 'system:role:update', 3, 3, 101, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1011, '角色删除', 'system:role:delete', 3, 4, 101, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1012, '角色导出', 'system:role:export', 3, 5, 101, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1013, '菜单查询', 'system:menu:query', 3, 1, 102, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1014, '菜单新增', 'system:menu:create', 3, 2, 102, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1015, '菜单修改', 'system:menu:update', 3, 3, 102, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1016, '菜单删除', 'system:menu:delete', 3, 4, 102, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1017, '部门查询', 'system:dept:query', 3, 1, 103, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1018, '部门新增', 'system:dept:create', 3, 2, 103, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1019, '部门修改', 'system:dept:update', 3, 3, 103, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1020, '部门删除', 'system:dept:delete', 3, 4, 103, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1021, '岗位查询', 'system:post:query', 3, 1, 104, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1022, '岗位新增', 'system:post:create', 3, 2, 104, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1023, '岗位修改', 'system:post:update', 3, 3, 104, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1024, '岗位删除', 'system:post:delete', 3, 4, 104, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1025, '岗位导出', 'system:post:export', 3, 5, 104, '', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1026, '字典查询', 'system:dict:query', 3, 1, 105, '#', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1027, '字典新增', 'system:dict:create', 3, 2, 105, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1028, '字典修改', 'system:dict:update', 3, 3, 105, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1029, '字典删除', 'system:dict:delete', 3, 4, 105, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1030, '字典导出', 'system:dict:export', 3, 5, 105, '#', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1031, '配置查询', 'infra:config:query', 3, 1, 106, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1032, '配置新增', 'infra:config:create', 3, 2, 106, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1033, '配置修改', 'infra:config:update', 3, 3, 106, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1034, '配置删除', 'infra:config:delete', 3, 4, 106, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1035, '配置导出', 'infra:config:export', 3, 5, 106, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1036, '公告查询', 'system:notice:query', 3, 1, 107, '#', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1037, '公告新增', 'system:notice:create', 3, 2, 107, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1038, '公告修改', 'system:notice:update', 3, 3, 107, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1039, '公告删除', 'system:notice:delete', 3, 4, 107, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1040, '操作查询', 'system:operate-log:query', 3, 1, 500, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1042, '日志导出', 'system:operate-log:export', 3, 2, 500, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1043, '登录查询', 'system:login-log:query', 3, 1, 501, '#', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1045, '日志导出', 'system:login-log:export', 3, 3, 501, '#', '#', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1046, '令牌列表', 'system:oauth2-token:page', 3, 1, 109, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-05-09 23:54:42', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1048, '令牌删除', 'system:oauth2-token:delete', 3, 2, 109, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-05-09 23:54:53', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1050, '任务新增', 'infra:job:create', 3, 2, 110, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1051, '任务修改', 'infra:job:update', 3, 3, 110, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1052, '任务删除', 'infra:job:delete', 3, 4, 110, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1053, '状态修改', 'infra:job:update', 3, 5, 110, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1054, '任务导出', 'infra:job:export', 3, 7, 110, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1056, '生成修改', 'infra:codegen:update', 3, 2, 115, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1057, '生成删除', 'infra:codegen:delete', 3, 3, 115, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1058, '导入代码', 'infra:codegen:create', 3, 2, 115, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1059, '预览代码', 'infra:codegen:preview', 3, 4, 115, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1060, '生成代码', 'infra:codegen:download', 3, 5, 115, '', '', '', 0, '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1063, '设置角色菜单权限', 'system:permission:assign-role-menu', 3, 6, 101, '', '', '', 0, '1', '1', '', '2021-01-06 17:53:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1064, '设置角色数据权限', 'system:permission:assign-role-data-scope', 3, 7, 101, '', '', '', 0, '1', '1', '', '2021-01-06 17:56:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1065, '设置用户角色', 'system:permission:assign-user-role', 3, 8, 101, '', '', '', 0, '1', '1', '', '2021-01-07 10:23:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1066, '获得 Redis 监控信息', 'infra:redis:get-monitor-info', 3, 1, 113, '', '', '', 0, '1', '1', '', '2021-01-26 01:02:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1067, '获得 Redis Key 列表', 'infra:redis:get-key-list', 3, 2, 113, '', '', '', 0, '1', '1', '', '2021-01-26 01:02:52', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1070, '代码生成示例', 'infra:test-demo:query', 2, 1, 2, 'test-demo', 'validCode', 'infra/testDemo/index', 0, '1', '1', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1071, '测试示例表创建', 'infra:test-demo:create', 3, 1, 1070, '', '', '', 0, '1', '1', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1072, '测试示例表更新', 'infra:test-demo:update', 3, 2, 1070, '', '', '', 0, '1', '1', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1073, '测试示例表删除', 'infra:test-demo:delete', 3, 3, 1070, '', '', '', 0, '1', '1', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1074, '测试示例表导出', 'infra:test-demo:export', 3, 4, 1070, '', '', '', 0, '1', '1', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1075, '任务触发', 'infra:job:trigger', 3, 8, 110, '', '', '', 0, '1', '1', '', '2021-02-07 13:03:10', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1076, '数据库文档', '', 2, 4, 2, 'db-doc', 'table', 'infra/dbDoc/index', 0, '1', '1', '', '2021-02-08 01:41:47', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1077, '监控平台', '', 2, 13, 2, 'skywalking', 'eye-open', 'infra/skywalking/index', 0, '1', '1', '', '2021-02-08 20:41:31', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1078, '访问日志', '', 2, 1, 1083, 'api-access-log', 'log', 'infra/apiAccessLog/index', 0, '1', '1', '', '2021-02-26 01:32:59', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1082, '日志导出', 'infra:api-access-log:export', 3, 2, 1078, '', '', '', 0, '1', '1', '', '2021-02-26 01:32:59', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1083, 'API 日志', '', 2, 8, 2, 'log', 'log', NULL, 0, '1', '1', '', '2021-02-26 02:18:24', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1084, '错误日志', 'infra:api-error-log:query', 2, 2, 1083, 'api-error-log', 'log', 'infra/apiErrorLog/index', 0, '1', '1', '', '2021-02-26 07:53:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1085, '日志处理', 'infra:api-error-log:update-status', 3, 2, 1084, '', '', '', 0, '1', '1', '', '2021-02-26 07:53:20', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1086, '日志导出', 'infra:api-error-log:export', 3, 3, 1084, '', '', '', 0, '1', '1', '', '2021-02-26 07:53:20', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1087, '任务查询', 'infra:job:query', 3, 1, 110, '', '', '', 0, '1', '1', '1', '2021-03-10 01:26:19', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1088, '日志查询', 'infra:api-access-log:query', 3, 1, 1078, '', '', '', 0, '1', '1', '1', '2021-03-10 01:28:04', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1089, '日志查询', 'infra:api-error-log:query', 3, 1, 1084, '', '', '', 0, '1', '1', '1', '2021-03-10 01:29:09', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1090, '文件列表', '', 2, 5, 1243, 'file', 'upload', 'infra/file/index', 0, '1', '1', '', '2021-03-12 20:16:20', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, '1', '1', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, '1', '1', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, '1', '1', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/smsChannel', 0, '1', '1', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, '1', '1', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, '1', '1', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, '1', '1', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, '1', '1', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/smsTemplate', 0, '1', '1', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, '1', '1', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, '1', '1', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, '1', '1', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, '1', '1', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, '1', '1', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, '1', '1', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/smsLog', 0, '1', '1', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, '1', '1', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, '1', '1', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, '1', '1', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1111, '错误码查询', 'system:error-code:query', 3, 1, 1110, '', '', '', 0, '1', '1', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1112, '错误码创建', 'system:error-code:create', 3, 2, 1110, '', '', '', 0, '1', '1', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1113, '错误码更新', 'system:error-code:update', 3, 3, 1110, '', '', '', 0, '1', '1', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1114, '错误码删除', 'system:error-code:delete', 3, 4, 1110, '', '', '', 0, '1', '1', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1115, '错误码导出', 'system:error-code:export', 3, 5, 1110, '', '', '', 0, '1', '1', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1118, '请假查询', '', 2, 0, 5, 'leave', 'user', 'bpm/oa/leave/index', 0, '1', '1', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1119, '请假申请查询', 'bpm:oa-leave:query', 3, 1, 1118, '', '', '', 0, '1', '1', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1120, '请假申请创建', 'bpm:oa-leave:create', 3, 2, 1118, '', '', '', 0, '1', '1', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1126, '应用信息', '', 2, 1, 1117, 'app', 'table', 'pay/app/index', 0, '1', '1', '', '2021-11-10 01:13:30', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1127, '支付应用信息查询', 'pay:app:query', 3, 1, 1126, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1128, '支付应用信息创建', 'pay:app:create', 3, 2, 1126, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1129, '支付应用信息更新', 'pay:app:update', 3, 3, 1126, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1130, '支付应用信息删除', 'pay:app:delete', 3, 4, 1126, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1131, '支付应用信息导出', 'pay:app:export', 3, 5, 1126, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1132, '秘钥解析', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '1', '1', '2021-11-08 15:15:47', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1133, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1132, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1134, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1132, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1135, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1132, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1136, '支付商户信息删除', 'pay:merchant:delete', 3, 4, 1132, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1137, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1132, '', '', '', 0, '1', '1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1138, '租户列表', '', 2, 0, 1224, 'list', 'peoples', 'system/tenant/index', 0, '1', '1', '', '2021-12-14 12:31:43', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1139, '租户查询', 'system:tenant:query', 3, 1, 1138, '', '', '', 0, '1', '1', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1140, '租户创建', 'system:tenant:create', 3, 2, 1138, '', '', '', 0, '1', '1', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1141, '租户更新', 'system:tenant:update', 3, 3, 1138, '', '', '', 0, '1', '1', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1142, '租户删除', 'system:tenant:delete', 3, 4, 1138, '', '', '', 0, '1', '1', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1143, '租户导出', 'system:tenant:export', 3, 5, 1138, '', '', '', 0, '1', '1', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1150, '秘钥解析', '', 3, 6, 1129, '', '', '', 0, '1', '1', '1', '2021-11-08 15:15:47', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1161, '退款订单', '', 2, 3, 1117, 'refund', 'order', 'pay/refund/index', 0, '1', '1', '', '2021-12-25 08:29:07', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1162, '退款订单查询', 'pay:refund:query', 3, 1, 1161, '', '', '', 0, '1', '1', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1163, '退款订单创建', 'pay:refund:create', 3, 2, 1161, '', '', '', 0, '1', '1', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1164, '退款订单更新', 'pay:refund:update', 3, 3, 1161, '', '', '', 0, '1', '1', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1165, '退款订单删除', 'pay:refund:delete', 3, 4, 1161, '', '', '', 0, '1', '1', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1166, '退款订单导出', 'pay:refund:export', 3, 5, 1161, '', '', '', 0, '1', '1', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1173, '支付订单', '', 2, 2, 1117, 'order', 'pay', 'pay/order/index', 0, '1', '1', '', '2021-12-25 08:49:43', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1174, '支付订单查询', 'pay:order:query', 3, 1, 1173, '', '', '', 0, '1', '1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1175, '支付订单创建', 'pay:order:create', 3, 2, 1173, '', '', '', 0, '1', '1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1176, '支付订单更新', 'pay:order:update', 3, 3, 1173, '', '', '', 0, '1', '1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1177, '支付订单删除', 'pay:order:delete', 3, 4, 1173, '', '', '', 0, '1', '1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1178, '支付订单导出', 'pay:order:export', 3, 5, 1173, '', '', '', 0, '1', '1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1179, '商户信息', '', 2, 0, 1117, 'merchant', 'merchant', 'pay/merchant/index', 0, '1', '1', '', '2021-12-25 09:01:44', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1180, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1179, '', '', '', 0, '1', '1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1181, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1179, '', '', '', 0, '1', '1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1182, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1179, '', '', '', 0, '1', '1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1183, '支付商户信息删除', '', 3, 4, 1179, '', '', '', 0, '1', '1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1184, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1179, '', '', '', 0, '1', '1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1185, '工作流程', '', 1, 50, 0, '/bpm', 'tool', NULL, 0, '1', '1', '1', '2021-12-30 20:26:36', '103', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1186, '流程管理', '', 1, 10, 1185, 'manager', 'nested', NULL, 0, '1', '1', '1', '2021-12-30 20:28:30', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1187, '流程表单', '', 2, 0, 1186, 'form', 'form', 'bpm/form/index', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1188, '表单查询', 'bpm:form:query', 3, 1, 1187, '', '', '', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1189, '表单创建', 'bpm:form:create', 3, 2, 1187, '', '', '', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1190, '表单更新', 'bpm:form:update', 3, 3, 1187, '', '', '', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1191, '表单删除', 'bpm:form:delete', 3, 4, 1187, '', '', '', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1192, '表单导出', 'bpm:form:export', 3, 5, 1187, '', '', '', 0, '1', '1', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1193, '流程模型', '', 2, 5, 1186, 'model', 'guide', 'bpm/model/index', 0, '1', '1', '1', '2021-12-31 23:24:58', '103', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1194, '模型查询', 'bpm:model:query', 3, 1, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:01:10', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1195, '模型创建', 'bpm:model:create', 3, 2, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:01:24', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1196, '模型导入', 'bpm:model:import', 3, 3, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:01:35', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1197, '模型更新', 'bpm:model:update', 3, 4, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:02:28', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1198, '模型删除', 'bpm:model:delete', 3, 5, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:02:43', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1199, '模型发布', 'bpm:model:deploy', 3, 6, 1193, '', '', '', 0, '1', '1', '1', '2022-01-03 19:03:24', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1200, '任务管理', '', 1, 20, 1185, 'task', 'cascader', NULL, 0, '1', '1', '1', '2022-01-07 23:51:48', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1201, '我的流程', '', 2, 0, 1200, 'my', 'people', 'bpm/processInstance/index', 0, '1', '1', '', '2022-01-07 15:53:44', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1202, '流程实例的查询', 'bpm:process-instance:query', 3, 1, 1201, '', '', '', 0, '1', '1', '', '2022-01-07 15:53:44', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1207, '待办任务', '', 2, 10, 1200, 'todo', 'eye-open', 'bpm/task/todo', 0, '1', '1', '1', '2022-01-08 10:33:37', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1208, '已办任务', '', 2, 20, 1200, 'done', 'eye', 'bpm/task/done', 0, '1', '1', '1', '2022-01-08 10:34:13', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1209, '用户分组', '', 2, 2, 1186, 'user-group', 'people', 'bpm/group/index', 0, '1', '1', '', '2022-01-14 02:14:20', '103', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1210, '用户组查询', 'bpm:user-group:query', 3, 1, 1209, '', '', '', 0, '1', '1', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1211, '用户组创建', 'bpm:user-group:create', 3, 2, 1209, '', '', '', 0, '1', '1', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1212, '用户组更新', 'bpm:user-group:update', 3, 3, 1209, '', '', '', 0, '1', '1', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1213, '用户组删除', 'bpm:user-group:delete', 3, 4, 1209, '', '', '', 0, '1', '1', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1215, '流程定义查询', 'bpm:process-definition:query', 3, 10, 1193, '', '', '', 0, '1', '1', '1', '2022-01-23 00:21:43', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1216, '流程任务分配规则查询', 'bpm:task-assign-rule:query', 3, 20, 1193, '', '', '', 0, '1', '1', '1', '2022-01-23 00:26:53', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1217, '流程任务分配规则创建', 'bpm:task-assign-rule:create', 3, 21, 1193, '', '', '', 0, '1', '1', '1', '2022-01-23 00:28:15', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1218, '流程任务分配规则更新', 'bpm:task-assign-rule:update', 3, 22, 1193, '', '', '', 0, '1', '1', '1', '2022-01-23 00:28:41', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1219, '流程实例的创建', 'bpm:process-instance:create', 3, 2, 1201, '', '', '', 0, '1', '1', '1', '2022-01-23 00:36:15', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1220, '流程实例的取消', 'bpm:process-instance:cancel', 3, 3, 1201, '', '', '', 0, '1', '1', '1', '2022-01-23 00:36:33', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1221, '流程任务的查询', 'bpm:task:query', 3, 1, 1207, '', '', '', 0, '1', '1', '1', '2022-01-23 00:38:52', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1222, '流程任务的更新', 'bpm:task:update', 3, 2, 1207, '', '', '', 0, '1', '1', '1', '2022-01-23 00:39:24', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1224, '租户管理', '', 2, 0, 1, 'tenant', 'peoples', NULL, 0, '1', '1', '1', '2022-02-20 01:41:13', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1225, '租户套餐', '', 2, 0, 1224, 'package', 'eye', 'system/tenantPackage/index', 0, '1', '1', '', '2022-02-19 17:44:06', '1', '2022-04-21 01:21:25', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1226, '租户套餐查询', 'system:tenant-package:query', 3, 1, 1225, '', '', '', 0, '1', '1', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1227, '租户套餐创建', 'system:tenant-package:create', 3, 2, 1225, '', '', '', 0, '1', '1', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1228, '租户套餐更新', 'system:tenant-package:update', 3, 3, 1225, '', '', '', 0, '1', '1', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1229, '租户套餐删除', 'system:tenant-package:delete', 3, 4, 1225, '', '', '', 0, '1', '1', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1237, '文件配置', '', 2, 0, 1243, 'file-config', 'config', 'infra/fileConfig/index', 0, '1', '1', '', '2022-03-15 14:35:28', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1238, '文件配置查询', 'infra:file-config:query', 3, 1, 1237, '', '', '', 0, '1', '1', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1239, '文件配置创建', 'infra:file-config:create', 3, 2, 1237, '', '', '', 0, '1', '1', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1240, '文件配置更新', 'infra:file-config:update', 3, 3, 1237, '', '', '', 0, '1', '1', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1241, '文件配置删除', 'infra:file-config:delete', 3, 4, 1237, '', '', '', 0, '1', '1', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1242, '文件配置导出', 'infra:file-config:export', 3, 5, 1237, '', '', '', 0, '1', '1', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1243, '文件管理', '', 2, 5, 2, 'file', 'download', NULL, 0, '1', '1', '1', '2022-03-16 23:47:40', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1247, '敏感词管理', '', 2, 13, 1, 'sensitive-word', 'education', 'system/sensitiveWord/index', 0, '1', '1', '', '2022-04-07 16:55:03', '1', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1248, '敏感词查询', 'system:sensitive-word:query', 3, 1, 1247, '', '', '', 0, '1', '1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1249, '敏感词创建', 'system:sensitive-word:create', 3, 2, 1247, '', '', '', 0, '1', '1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1250, '敏感词更新', 'system:sensitive-word:update', 3, 3, 1247, '', '', '', 0, '1', '1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1251, '敏感词删除', 'system:sensitive-word:delete', 3, 4, 1247, '', '', '', 0, '1', '1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1252, '敏感词导出', 'system:sensitive-word:export', 3, 5, 1247, '', '', '', 0, '1', '1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1254, '作者动态', '', 1, 0, 0, 'https://www.iocoder.cn', 'people', NULL, 0, '1', '1', '1', '2022-04-23 01:03:15', '1', '2022-04-23 01:03:15', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1255, '数据源配置', '', 2, 1, 2, 'data-source-config', 'rate', 'infra/dataSourceConfig/index', 0, '1', '1', '', '2022-04-27 14:37:32', '1', '2022-04-27 22:42:06', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1256, '数据源配置查询', 'infra:data-source-config:query', 3, 1, 1255, '', '', '', 0, '1', '1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1257, '数据源配置创建', 'infra:data-source-config:create', 3, 2, 1255, '', '', '', 0, '1', '1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1258, '数据源配置更新', 'infra:data-source-config:update', 3, 3, 1255, '', '', '', 0, '1', '1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1259, '数据源配置删除', 'infra:data-source-config:delete', 3, 4, 1255, '', '', '', 0, '1', '1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1260, '数据源配置导出', 'infra:data-source-config:export', 3, 5, 1255, '', '', '', 0, '1', '1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1261, 'OAuth 2.0', '', 1, 10, 1, 'oauth2', 'people', NULL, 0, '1', '1', '1', '2022-05-09 23:38:17', '1', '2022-05-11 23:51:46', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1263, '应用管理', '', 2, 0, 1261, 'oauth2/application', 'tool', 'system/oauth2/client/index', 0, '1', '1', '', '2022-05-10 16:26:33', '1', '2022-05-11 23:31:36', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1264, '客户端查询', 'system:oauth2-client:query', 3, 1, 1263, '', '', '', 0, '1', '1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:06', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, '1', '1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, '1', '1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, '1', '1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1117, '支付管理', '', 1, 11, 0, '/pay', 'money', NULL, 0, 'true', 'true', '1', '2021-12-25 16:43:41', '1', '2022-05-13 01:02:25.244', 0); -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1, '系统管理', '', 1, 10, 0, '/system', 'system', NULL, 0, 'true', 'true', 'admin', '2021-01-05 17:03:48', '1', '2022-05-13 01:02:57.073', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (2, '基础设施', '', 1, 20, 0, '/infra', 'monitor', NULL, 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (5, 'OA 示例', '', 1, 40, 1185, 'oa', 'people', NULL, 0, 't', 't', 'admin', '2021-09-20 16:26:19', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'user', 'system/user/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'peoples', 'system/role/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'tree-table', 'system/menu/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (103, '部门管理', '', 2, 4, 1, 'dept', 'tree', 'system/dept/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (104, '岗位管理', '', 2, 5, 1, 'post', 'post', 'system/post/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (105, '字典管理', '', 2, 6, 1, 'dict', 'dict', 'system/dict/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (106, '配置管理', '', 2, 6, 2, 'config', 'edit', 'infra/config/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (107, '通知公告', '', 2, 8, 1, 'notice', 'message', 'system/notice/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (108, '审计日志', '', 1, 9, 1, 'log', 'log', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (109, '令牌管理', '', 2, 2, 1261, 'token', 'online', 'system/oauth2/token/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-05-11 23:31:42', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (110, '定时任务', '', 2, 12, 2, 'job', 'job', 'infra/job/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (111, 'MySQL 监控', '', 2, 9, 2, 'druid', 'druid', 'infra/druid/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (112, 'Java 监控', '', 2, 11, 2, 'admin-server', 'server', 'infra/server/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (113, 'Redis 监控', '', 2, 10, 2, 'redis', 'redis', 'infra/redis/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (114, '表单构建', 'infra:build:list', 2, 2, 2, 'build', 'build', 'infra/build/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (115, '代码生成', 'infra:codegen:query', 2, 1, 2, 'codegen', 'code', 'infra/codegen/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (116, '系统接口', 'infra:swagger:list', 2, 3, 2, 'swagger', 'swagger', 'infra/swagger/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (500, '操作日志', '', 2, 1, 108, 'operate-log', 'form', 'system/operatelog/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (501, '登录日志', '', 2, 2, 108, 'login-log', 'logininfor', 'system/loginlog/index', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1001, '用户查询', 'system:user:query', 3, 1, 100, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1002, '用户新增', 'system:user:create', 3, 2, 100, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1003, '用户修改', 'system:user:update', 3, 3, 100, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1004, '用户删除', 'system:user:delete', 3, 4, 100, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1005, '用户导出', 'system:user:export', 3, 5, 100, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1006, '用户导入', 'system:user:import', 3, 6, 100, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1007, '重置密码', 'system:user:update-password', 3, 7, 100, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1008, '角色查询', 'system:role:query', 3, 1, 101, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1009, '角色新增', 'system:role:create', 3, 2, 101, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1010, '角色修改', 'system:role:update', 3, 3, 101, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1011, '角色删除', 'system:role:delete', 3, 4, 101, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1012, '角色导出', 'system:role:export', 3, 5, 101, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1013, '菜单查询', 'system:menu:query', 3, 1, 102, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1014, '菜单新增', 'system:menu:create', 3, 2, 102, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1015, '菜单修改', 'system:menu:update', 3, 3, 102, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1016, '菜单删除', 'system:menu:delete', 3, 4, 102, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1017, '部门查询', 'system:dept:query', 3, 1, 103, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1018, '部门新增', 'system:dept:create', 3, 2, 103, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1019, '部门修改', 'system:dept:update', 3, 3, 103, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1020, '部门删除', 'system:dept:delete', 3, 4, 103, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1021, '岗位查询', 'system:post:query', 3, 1, 104, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1022, '岗位新增', 'system:post:create', 3, 2, 104, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1023, '岗位修改', 'system:post:update', 3, 3, 104, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1024, '岗位删除', 'system:post:delete', 3, 4, 104, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1025, '岗位导出', 'system:post:export', 3, 5, 104, '', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1026, '字典查询', 'system:dict:query', 3, 1, 105, '#', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1027, '字典新增', 'system:dict:create', 3, 2, 105, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1028, '字典修改', 'system:dict:update', 3, 3, 105, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1029, '字典删除', 'system:dict:delete', 3, 4, 105, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1030, '字典导出', 'system:dict:export', 3, 5, 105, '#', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1031, '配置查询', 'infra:config:query', 3, 1, 106, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1032, '配置新增', 'infra:config:create', 3, 2, 106, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1033, '配置修改', 'infra:config:update', 3, 3, 106, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1034, '配置删除', 'infra:config:delete', 3, 4, 106, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1035, '配置导出', 'infra:config:export', 3, 5, 106, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1036, '公告查询', 'system:notice:query', 3, 1, 107, '#', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1037, '公告新增', 'system:notice:create', 3, 2, 107, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1038, '公告修改', 'system:notice:update', 3, 3, 107, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1039, '公告删除', 'system:notice:delete', 3, 4, 107, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1040, '操作查询', 'system:operate-log:query', 3, 1, 500, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1042, '日志导出', 'system:operate-log:export', 3, 2, 500, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1043, '登录查询', 'system:login-log:query', 3, 1, 501, '#', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1045, '日志导出', 'system:login-log:export', 3, 3, 501, '#', '#', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1046, '令牌列表', 'system:oauth2-token:page', 3, 1, 109, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-05-09 23:54:42', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1048, '令牌删除', 'system:oauth2-token:delete', 3, 2, 109, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-05-09 23:54:53', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1050, '任务新增', 'infra:job:create', 3, 2, 110, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1051, '任务修改', 'infra:job:update', 3, 3, 110, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1052, '任务删除', 'infra:job:delete', 3, 4, 110, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1053, '状态修改', 'infra:job:update', 3, 5, 110, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1054, '任务导出', 'infra:job:export', 3, 7, 110, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1056, '生成修改', 'infra:codegen:update', 3, 2, 115, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1057, '生成删除', 'infra:codegen:delete', 3, 3, 115, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1058, '导入代码', 'infra:codegen:create', 3, 2, 115, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1059, '预览代码', 'infra:codegen:preview', 3, 4, 115, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1060, '生成代码', 'infra:codegen:download', 3, 5, 115, '', '', '', 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1063, '设置角色菜单权限', 'system:permission:assign-role-menu', 3, 6, 101, '', '', '', 0, 't', 't', '', '2021-01-06 17:53:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1064, '设置角色数据权限', 'system:permission:assign-role-data-scope', 3, 7, 101, '', '', '', 0, 't', 't', '', '2021-01-06 17:56:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1065, '设置用户角色', 'system:permission:assign-user-role', 3, 8, 101, '', '', '', 0, 't', 't', '', '2021-01-07 10:23:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1066, '获得 Redis 监控信息', 'infra:redis:get-monitor-info', 3, 1, 113, '', '', '', 0, 't', 't', '', '2021-01-26 01:02:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1067, '获得 Redis Key 列表', 'infra:redis:get-key-list', 3, 2, 113, '', '', '', 0, 't', 't', '', '2021-01-26 01:02:52', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1070, '代码生成示例', 'infra:test-demo:query', 2, 1, 2, 'test-demo', 'validCode', 'infra/testDemo/index', 0, 't', 't', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1071, '测试示例表创建', 'infra:test-demo:create', 3, 1, 1070, '', '', '', 0, 't', 't', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1072, '测试示例表更新', 'infra:test-demo:update', 3, 2, 1070, '', '', '', 0, 't', 't', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1073, '测试示例表删除', 'infra:test-demo:delete', 3, 3, 1070, '', '', '', 0, 't', 't', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1074, '测试示例表导出', 'infra:test-demo:export', 3, 4, 1070, '', '', '', 0, 't', 't', '', '2021-02-06 12:42:49', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1075, '任务触发', 'infra:job:trigger', 3, 8, 110, '', '', '', 0, 't', 't', '', '2021-02-07 13:03:10', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1076, '数据库文档', '', 2, 4, 2, 'db-doc', 'table', 'infra/dbDoc/index', 0, 't', 't', '', '2021-02-08 01:41:47', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1077, '监控平台', '', 2, 13, 2, 'skywalking', 'eye-open', 'infra/skywalking/index', 0, 't', 't', '', '2021-02-08 20:41:31', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1078, '访问日志', '', 2, 1, 1083, 'api-access-log', 'log', 'infra/apiAccessLog/index', 0, 't', 't', '', '2021-02-26 01:32:59', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1082, '日志导出', 'infra:api-access-log:export', 3, 2, 1078, '', '', '', 0, 't', 't', '', '2021-02-26 01:32:59', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1083, 'API 日志', '', 2, 8, 2, 'log', 'log', NULL, 0, 't', 't', '', '2021-02-26 02:18:24', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1084, '错误日志', 'infra:api-error-log:query', 2, 2, 1083, 'api-error-log', 'log', 'infra/apiErrorLog/index', 0, 't', 't', '', '2021-02-26 07:53:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1085, '日志处理', 'infra:api-error-log:update-status', 3, 2, 1084, '', '', '', 0, 't', 't', '', '2021-02-26 07:53:20', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1086, '日志导出', 'infra:api-error-log:export', 3, 3, 1084, '', '', '', 0, 't', 't', '', '2021-02-26 07:53:20', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1087, '任务查询', 'infra:job:query', 3, 1, 110, '', '', '', 0, 't', 't', '1', '2021-03-10 01:26:19', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1088, '日志查询', 'infra:api-access-log:query', 3, 1, 1078, '', '', '', 0, 't', 't', '1', '2021-03-10 01:28:04', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1089, '日志查询', 'infra:api-error-log:query', 3, 1, 1084, '', '', '', 0, 't', 't', '1', '2021-03-10 01:29:09', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1090, '文件列表', '', 2, 5, 1243, 'file', 'upload', 'infra/file/index', 0, 't', 't', '', '2021-03-12 20:16:20', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, 't', 't', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/smsChannel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/smsTemplate', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, 't', 't', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/smsLog', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, 't', 't', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1111, '错误码查询', 'system:error-code:query', 3, 1, 1110, '', '', '', 0, 't', 't', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1112, '错误码创建', 'system:error-code:create', 3, 2, 1110, '', '', '', 0, 't', 't', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1113, '错误码更新', 'system:error-code:update', 3, 3, 1110, '', '', '', 0, 't', 't', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1114, '错误码删除', 'system:error-code:delete', 3, 4, 1110, '', '', '', 0, 't', 't', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1115, '错误码导出', 'system:error-code:export', 3, 5, 1110, '', '', '', 0, 't', 't', '', '2021-04-13 21:46:42', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1118, '请假查询', '', 2, 0, 5, 'leave', 'user', 'bpm/oa/leave/index', 0, 't', 't', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1119, '请假申请查询', 'bpm:oa-leave:query', 3, 1, 1118, '', '', '', 0, 't', 't', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1120, '请假申请创建', 'bpm:oa-leave:create', 3, 2, 1118, '', '', '', 0, 't', 't', '', '2021-09-20 08:51:03', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1126, '应用信息', '', 2, 1, 1117, 'app', 'table', 'pay/app/index', 0, 't', 't', '', '2021-11-10 01:13:30', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1127, '支付应用信息查询', 'pay:app:query', 3, 1, 1126, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1128, '支付应用信息创建', 'pay:app:create', 3, 2, 1126, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1129, '支付应用信息更新', 'pay:app:update', 3, 3, 1126, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1130, '支付应用信息删除', 'pay:app:delete', 3, 4, 1126, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1131, '支付应用信息导出', 'pay:app:export', 3, 5, 1126, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1132, '秘钥解析', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, 't', 't', '1', '2021-11-08 15:15:47', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1133, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1132, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1134, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1132, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1135, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1132, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1136, '支付商户信息删除', 'pay:merchant:delete', 3, 4, 1132, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1137, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1132, '', '', '', 0, 't', 't', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1138, '租户列表', '', 2, 0, 1224, 'list', 'peoples', 'system/tenant/index', 0, 't', 't', '', '2021-12-14 12:31:43', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1139, '租户查询', 'system:tenant:query', 3, 1, 1138, '', '', '', 0, 't', 't', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1140, '租户创建', 'system:tenant:create', 3, 2, 1138, '', '', '', 0, 't', 't', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1141, '租户更新', 'system:tenant:update', 3, 3, 1138, '', '', '', 0, 't', 't', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1142, '租户删除', 'system:tenant:delete', 3, 4, 1138, '', '', '', 0, 't', 't', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1143, '租户导出', 'system:tenant:export', 3, 5, 1138, '', '', '', 0, 't', 't', '', '2021-12-14 12:31:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1150, '秘钥解析', '', 3, 6, 1129, '', '', '', 0, 't', 't', '1', '2021-11-08 15:15:47', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1161, '退款订单', '', 2, 3, 1117, 'refund', 'order', 'pay/refund/index', 0, 't', 't', '', '2021-12-25 08:29:07', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1162, '退款订单查询', 'pay:refund:query', 3, 1, 1161, '', '', '', 0, 't', 't', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1163, '退款订单创建', 'pay:refund:create', 3, 2, 1161, '', '', '', 0, 't', 't', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1164, '退款订单更新', 'pay:refund:update', 3, 3, 1161, '', '', '', 0, 't', 't', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1165, '退款订单删除', 'pay:refund:delete', 3, 4, 1161, '', '', '', 0, 't', 't', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1166, '退款订单导出', 'pay:refund:export', 3, 5, 1161, '', '', '', 0, 't', 't', '', '2021-12-25 08:29:07', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1173, '支付订单', '', 2, 2, 1117, 'order', 'pay', 'pay/order/index', 0, 't', 't', '', '2021-12-25 08:49:43', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1174, '支付订单查询', 'pay:order:query', 3, 1, 1173, '', '', '', 0, 't', 't', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1175, '支付订单创建', 'pay:order:create', 3, 2, 1173, '', '', '', 0, 't', 't', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1176, '支付订单更新', 'pay:order:update', 3, 3, 1173, '', '', '', 0, 't', 't', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1177, '支付订单删除', 'pay:order:delete', 3, 4, 1173, '', '', '', 0, 't', 't', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1178, '支付订单导出', 'pay:order:export', 3, 5, 1173, '', '', '', 0, 't', 't', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1179, '商户信息', '', 2, 0, 1117, 'merchant', 'merchant', 'pay/merchant/index', 0, 't', 't', '', '2021-12-25 09:01:44', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1180, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1179, '', '', '', 0, 't', 't', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1181, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1179, '', '', '', 0, 't', 't', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1182, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1179, '', '', '', 0, 't', 't', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1183, '支付商户信息删除', '', 3, 4, 1179, '', '', '', 0, 't', 't', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1184, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1179, '', '', '', 0, 't', 't', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1185, '工作流程', '', 1, 50, 0, '/bpm', 'tool', NULL, 0, 't', 't', '1', '2021-12-30 20:26:36', '103', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1186, '流程管理', '', 1, 10, 1185, 'manager', 'nested', NULL, 0, 't', 't', '1', '2021-12-30 20:28:30', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1187, '流程表单', '', 2, 0, 1186, 'form', 'form', 'bpm/form/index', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1188, '表单查询', 'bpm:form:query', 3, 1, 1187, '', '', '', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1189, '表单创建', 'bpm:form:create', 3, 2, 1187, '', '', '', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1190, '表单更新', 'bpm:form:update', 3, 3, 1187, '', '', '', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1191, '表单删除', 'bpm:form:delete', 3, 4, 1187, '', '', '', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1192, '表单导出', 'bpm:form:export', 3, 5, 1187, '', '', '', 0, 't', 't', '', '2021-12-30 12:38:22', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1193, '流程模型', '', 2, 5, 1186, 'model', 'guide', 'bpm/model/index', 0, 't', 't', '1', '2021-12-31 23:24:58', '103', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1194, '模型查询', 'bpm:model:query', 3, 1, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:01:10', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1195, '模型创建', 'bpm:model:create', 3, 2, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:01:24', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1196, '模型导入', 'bpm:model:import', 3, 3, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:01:35', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1197, '模型更新', 'bpm:model:update', 3, 4, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:02:28', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1198, '模型删除', 'bpm:model:delete', 3, 5, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:02:43', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1199, '模型发布', 'bpm:model:deploy', 3, 6, 1193, '', '', '', 0, 't', 't', '1', '2022-01-03 19:03:24', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1200, '任务管理', '', 1, 20, 1185, 'task', 'cascader', NULL, 0, 't', 't', '1', '2022-01-07 23:51:48', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1201, '我的流程', '', 2, 0, 1200, 'my', 'people', 'bpm/processInstance/index', 0, 't', 't', '', '2022-01-07 15:53:44', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1202, '流程实例的查询', 'bpm:process-instance:query', 3, 1, 1201, '', '', '', 0, 't', 't', '', '2022-01-07 15:53:44', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1207, '待办任务', '', 2, 10, 1200, 'todo', 'eye-open', 'bpm/task/todo', 0, 't', 't', '1', '2022-01-08 10:33:37', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1208, '已办任务', '', 2, 20, 1200, 'done', 'eye', 'bpm/task/done', 0, 't', 't', '1', '2022-01-08 10:34:13', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1209, '用户分组', '', 2, 2, 1186, 'user-group', 'people', 'bpm/group/index', 0, 't', 't', '', '2022-01-14 02:14:20', '103', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1210, '用户组查询', 'bpm:user-group:query', 3, 1, 1209, '', '', '', 0, 't', 't', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1211, '用户组创建', 'bpm:user-group:create', 3, 2, 1209, '', '', '', 0, 't', 't', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1212, '用户组更新', 'bpm:user-group:update', 3, 3, 1209, '', '', '', 0, 't', 't', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1213, '用户组删除', 'bpm:user-group:delete', 3, 4, 1209, '', '', '', 0, 't', 't', '', '2022-01-14 02:14:20', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1215, '流程定义查询', 'bpm:process-definition:query', 3, 10, 1193, '', '', '', 0, 't', 't', '1', '2022-01-23 00:21:43', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1216, '流程任务分配规则查询', 'bpm:task-assign-rule:query', 3, 20, 1193, '', '', '', 0, 't', 't', '1', '2022-01-23 00:26:53', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1217, '流程任务分配规则创建', 'bpm:task-assign-rule:create', 3, 21, 1193, '', '', '', 0, 't', 't', '1', '2022-01-23 00:28:15', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1218, '流程任务分配规则更新', 'bpm:task-assign-rule:update', 3, 22, 1193, '', '', '', 0, 't', 't', '1', '2022-01-23 00:28:41', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1219, '流程实例的创建', 'bpm:process-instance:create', 3, 2, 1201, '', '', '', 0, 't', 't', '1', '2022-01-23 00:36:15', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1220, '流程实例的取消', 'bpm:process-instance:cancel', 3, 3, 1201, '', '', '', 0, 't', 't', '1', '2022-01-23 00:36:33', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1221, '流程任务的查询', 'bpm:task:query', 3, 1, 1207, '', '', '', 0, 't', 't', '1', '2022-01-23 00:38:52', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1222, '流程任务的更新', 'bpm:task:update', 3, 2, 1207, '', '', '', 0, 't', 't', '1', '2022-01-23 00:39:24', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1224, '租户管理', '', 2, 0, 1, 'tenant', 'peoples', NULL, 0, 't', 't', '1', '2022-02-20 01:41:13', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1225, '租户套餐', '', 2, 0, 1224, 'package', 'eye', 'system/tenantPackage/index', 0, 't', 't', '', '2022-02-19 17:44:06', '1', '2022-04-21 01:21:25', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1226, '租户套餐查询', 'system:tenant-package:query', 3, 1, 1225, '', '', '', 0, 't', 't', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1227, '租户套餐创建', 'system:tenant-package:create', 3, 2, 1225, '', '', '', 0, 't', 't', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1228, '租户套餐更新', 'system:tenant-package:update', 3, 3, 1225, '', '', '', 0, 't', 't', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1229, '租户套餐删除', 'system:tenant-package:delete', 3, 4, 1225, '', '', '', 0, 't', 't', '', '2022-02-19 17:44:06', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1237, '文件配置', '', 2, 0, 1243, 'file-config', 'config', 'infra/fileConfig/index', 0, 't', 't', '', '2022-03-15 14:35:28', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1238, '文件配置查询', 'infra:file-config:query', 3, 1, 1237, '', '', '', 0, 't', 't', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1239, '文件配置创建', 'infra:file-config:create', 3, 2, 1237, '', '', '', 0, 't', 't', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1240, '文件配置更新', 'infra:file-config:update', 3, 3, 1237, '', '', '', 0, 't', 't', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1241, '文件配置删除', 'infra:file-config:delete', 3, 4, 1237, '', '', '', 0, 't', 't', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1242, '文件配置导出', 'infra:file-config:export', 3, 5, 1237, '', '', '', 0, 't', 't', '', '2022-03-15 14:35:28', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1243, '文件管理', '', 2, 5, 2, 'file', 'download', NULL, 0, 't', 't', '1', '2022-03-16 23:47:40', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1247, '敏感词管理', '', 2, 13, 1, 'sensitive-word', 'education', 'system/sensitiveWord/index', 0, 't', 't', '', '2022-04-07 16:55:03', '1', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1248, '敏感词查询', 'system:sensitive-word:query', 3, 1, 1247, '', '', '', 0, 't', 't', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1249, '敏感词创建', 'system:sensitive-word:create', 3, 2, 1247, '', '', '', 0, 't', 't', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1250, '敏感词更新', 'system:sensitive-word:update', 3, 3, 1247, '', '', '', 0, 't', 't', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1251, '敏感词删除', 'system:sensitive-word:delete', 3, 4, 1247, '', '', '', 0, 't', 't', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1252, '敏感词导出', 'system:sensitive-word:export', 3, 5, 1247, '', '', '', 0, 't', 't', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1254, '作者动态', '', 1, 0, 0, 'https://www.iocoder.cn', 'people', NULL, 0, 't', 't', '1', '2022-04-23 01:03:15', '1', '2022-04-23 01:03:15', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1255, '数据源配置', '', 2, 1, 2, 'data-source-config', 'rate', 'infra/dataSourceConfig/index', 0, 't', 't', '', '2022-04-27 14:37:32', '1', '2022-04-27 22:42:06', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1256, '数据源配置查询', 'infra:data-source-config:query', 3, 1, 1255, '', '', '', 0, 't', 't', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1257, '数据源配置创建', 'infra:data-source-config:create', 3, 2, 1255, '', '', '', 0, 't', 't', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1258, '数据源配置更新', 'infra:data-source-config:update', 3, 3, 1255, '', '', '', 0, 't', 't', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1259, '数据源配置删除', 'infra:data-source-config:delete', 3, 4, 1255, '', '', '', 0, 't', 't', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1260, '数据源配置导出', 'infra:data-source-config:export', 3, 5, 1255, '', '', '', 0, 't', 't', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1261, 'OAuth 2.0', '', 1, 10, 1, 'oauth2', 'people', NULL, 0, 't', 't', '1', '2022-05-09 23:38:17', '1', '2022-05-11 23:51:46', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1263, '应用管理', '', 2, 0, 1261, 'oauth2/application', 'tool', 'system/oauth2/client/index', 0, 't', 't', '', '2022-05-10 16:26:33', '1', '2022-05-11 23:31:36', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1264, '客户端查询', 'system:oauth2-client:query', 3, 1, 1263, '', '', '', 0, 't', 't', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:06', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, 't', 't', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, 't', 't', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, 't', 't', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1117, '支付管理', '', 1, 11, 0, '/pay', 'money', NULL, 0, 't', 't', '1', '2021-12-25 16:43:41', '1', '2022-05-13 01:02:25.244', 0); +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1, '系统管理', '', 1, 10, 0, '/system', 'system', NULL, 0, 't', 't', 'admin', '2021-01-05 17:03:48', '1', '2022-05-13 01:02:57.073', 0); COMMIT; -- ---------------------------- @@ -3391,7 +3366,8 @@ CREATE TABLE "system_oauth2_access_token" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL + "tenant_id" int8 NOT NULL, + "scopes" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying ) ; COMMENT ON COLUMN "system_oauth2_access_token"."id" IS '编号'; @@ -3407,6 +3383,7 @@ COMMENT ON COLUMN "system_oauth2_access_token"."updater" IS '更新者'; COMMENT ON COLUMN "system_oauth2_access_token"."update_time" IS '更新时间'; COMMENT ON COLUMN "system_oauth2_access_token"."deleted" IS '是否删除'; COMMENT ON COLUMN "system_oauth2_access_token"."tenant_id" IS '租户编号'; +COMMENT ON COLUMN "system_oauth2_access_token"."scopes" IS '授权范围'; COMMENT ON TABLE "system_oauth2_access_token" IS '刷新令牌'; -- ---------------------------- @@ -3430,7 +3407,6 @@ CREATE TABLE "system_oauth2_client" ( "access_token_validity_seconds" int4 NOT NULL, "refresh_token_validity_seconds" int4 NOT NULL, "redirect_uris" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, - "auto_approve" varchar(4) COLLATE "pg_catalog"."default" NOT NULL, "authorized_grant_types" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, "scopes" varchar(255) COLLATE "pg_catalog"."default", "authorities" varchar(255) COLLATE "pg_catalog"."default", @@ -3440,7 +3416,8 @@ CREATE TABLE "system_oauth2_client" ( "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, - "deleted" int2 NOT NULL DEFAULT 0 + "deleted" int2 NOT NULL DEFAULT 0, + "auto_approve_scopes" varchar(255) COLLATE "pg_catalog"."default" ) ; COMMENT ON COLUMN "system_oauth2_client"."id" IS '编号'; @@ -3453,7 +3430,6 @@ COMMENT ON COLUMN "system_oauth2_client"."status" IS '状态'; COMMENT ON COLUMN "system_oauth2_client"."access_token_validity_seconds" IS '访问令牌的有效期'; COMMENT ON COLUMN "system_oauth2_client"."refresh_token_validity_seconds" IS '刷新令牌的有效期'; COMMENT ON COLUMN "system_oauth2_client"."redirect_uris" IS '可重定向的 URI 地址'; -COMMENT ON COLUMN "system_oauth2_client"."auto_approve" IS '是否自动授权'; COMMENT ON COLUMN "system_oauth2_client"."authorized_grant_types" IS '授权类型'; COMMENT ON COLUMN "system_oauth2_client"."scopes" IS '授权范围'; COMMENT ON COLUMN "system_oauth2_client"."authorities" IS '权限'; @@ -3464,14 +3440,15 @@ COMMENT ON COLUMN "system_oauth2_client"."create_time" IS '创建时间'; COMMENT ON COLUMN "system_oauth2_client"."updater" IS '更新者'; COMMENT ON COLUMN "system_oauth2_client"."update_time" IS '更新时间'; COMMENT ON COLUMN "system_oauth2_client"."deleted" IS '是否删除'; +COMMENT ON COLUMN "system_oauth2_client"."auto_approve_scopes" IS '自动通过的授权范围'; COMMENT ON TABLE "system_oauth2_client" IS 'OAuth2 客户端表'; -- ---------------------------- -- Records of system_oauth2_client -- ---------------------------- BEGIN; -INSERT INTO "system_oauth2_client" ("id", "client_id", "secret", "name", "logo", "description", "status", "access_token_validity_seconds", "refresh_token_validity_seconds", "redirect_uris", "auto_approve", "authorized_grant_types", "scopes", "authorities", "resource_ids", "additional_information", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1, 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', 0, 999999999, 8640, '["https://www.iocoder.cn","https://doc.iocoder.cn"]', '1', '["password","authorization_code","implicit","refresh_token"]', '["user_info"]', '["system:user:query"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2022-05-12 01:00:20', 0); -INSERT INTO "system_oauth2_client" ("id", "client_id", "secret", "name", "logo", "description", "status", "access_token_validity_seconds", "refresh_token_validity_seconds", "redirect_uris", "auto_approve", "authorized_grant_types", "scopes", "authorities", "resource_ids", "additional_information", "creator", "create_time", "updater", "update_time", "deleted") VALUES (40, 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, 0, 1800, 43200, '["https://www.iocoder.cn"]', 'true', '["password","authorization_code","implicit"]', '[]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2022-05-13 01:04:21.023', 0); +INSERT INTO "system_oauth2_client" ("id", "client_id", "secret", "name", "logo", "description", "status", "access_token_validity_seconds", "refresh_token_validity_seconds", "redirect_uris", "authorized_grant_types", "scopes", "authorities", "resource_ids", "additional_information", "creator", "create_time", "updater", "update_time", "deleted", "auto_approve_scopes") VALUES (1, 'default', 'admin123', '芋道源码', 'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', '我是描述', 0, 180, 8640, '["https://www.iocoder.cn","https://doc.iocoder.cn"]', '["password","authorization_code","implicit","refresh_token"]', '["user.read","user.write"]', '["system:user:query"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2022-05-12 01:00:20', 0, NULL); +INSERT INTO "system_oauth2_client" ("id", "client_id", "secret", "name", "logo", "description", "status", "access_token_validity_seconds", "refresh_token_validity_seconds", "redirect_uris", "authorized_grant_types", "scopes", "authorities", "resource_ids", "additional_information", "creator", "create_time", "updater", "update_time", "deleted", "auto_approve_scopes") VALUES (40, 'test', 'test2', 'biubiu', 'http://test.yudao.iocoder.cn/277a899d573723f1fcdfb57340f00379.png', NULL, 0, 1800, 43200, '["https://www.iocoder.cn"]', '["password","authorization_code","implicit"]', '[]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2022-05-25 23:45:33.005', 0, '[]'); COMMIT; -- ---------------------------- @@ -3490,7 +3467,8 @@ CREATE TABLE "system_oauth2_refresh_token" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL + "tenant_id" int8 NOT NULL, + "scopes" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying ) ; COMMENT ON COLUMN "system_oauth2_refresh_token"."id" IS '编号'; @@ -3505,6 +3483,7 @@ COMMENT ON COLUMN "system_oauth2_refresh_token"."updater" IS '更新者'; COMMENT ON COLUMN "system_oauth2_refresh_token"."update_time" IS '更新时间'; COMMENT ON COLUMN "system_oauth2_refresh_token"."deleted" IS '是否删除'; COMMENT ON COLUMN "system_oauth2_refresh_token"."tenant_id" IS '租户编号'; +COMMENT ON COLUMN "system_oauth2_refresh_token"."scopes" IS '授权范围'; COMMENT ON TABLE "system_oauth2_refresh_token" IS '刷新令牌'; -- ---------------------------- @@ -3940,7 +3919,7 @@ COMMIT; DROP TABLE IF EXISTS "system_sms_channel"; CREATE TABLE "system_sms_channel" ( "id" int8 NOT NULL, - "signature" varchar(10) COLLATE "pg_catalog"."default" NOT NULL, + "signature" varchar(12) COLLATE "pg_catalog"."default" NOT NULL, "code" varchar(63) COLLATE "pg_catalog"."default" NOT NULL, "status" int2 NOT NULL, "remark" varchar(255) COLLATE "pg_catalog"."default", @@ -3990,7 +3969,7 @@ CREATE TABLE "system_sms_code" ( "create_ip" varchar(15) COLLATE "pg_catalog"."default" NOT NULL, "scene" int2 NOT NULL, "today_index" int2 NOT NULL, - "used" int2 NOT NULL, + "used" bool NOT NULL, "used_time" timestamp(6), "used_ip" varchar(255) COLLATE "pg_catalog"."default", "creator" varchar(64) COLLATE "pg_catalog"."default", @@ -4471,7 +4450,7 @@ INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", "dept_id", "post_ids", "email", "mobile", "sex", "avatar", "status", "login_ip", "login_date", "creator", "create_time", "updater", "update_time", "deleted", "tenant_id") VALUES (113, 'aoteman', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '127.0.0.1', '2022-03-19 18:38:51', '1', '2022-03-07 21:37:58', NULL, '2022-03-19 18:38:51', 0, 122); INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", "dept_id", "post_ids", "email", "mobile", "sex", "avatar", "status", "login_ip", "login_date", "creator", "create_time", "updater", "update_time", "deleted", "tenant_id") VALUES (114, 'hrmgr', '$2a$10$TR4eybBioGRhBmDBWkqWLO6NIh3mzYa8KBKDDB5woiGYFVlRAi.fu', 'hr 小姐姐', NULL, NULL, '[3]', '', '', 0, '', 0, '127.0.0.1', '2022-03-19 22:15:43', '1', '2022-03-19 21:50:58', NULL, '2022-03-19 22:15:43', 0, 1); INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", "dept_id", "post_ids", "email", "mobile", "sex", "avatar", "status", "login_ip", "login_date", "creator", "create_time", "updater", "update_time", "deleted", "tenant_id") VALUES (115, 'aotemane', '$2a$10$/WCwGHu1eq0wOVDd/u8HweJ0gJCHyLS6T7ndCqI8UXZAQom1etk2e', '1', '11', 100, '[]', '', '', 0, '', 0, '', NULL, '1', '2022-04-30 02:55:43', '1', '2022-04-30 02:55:43', 0, 1); -INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", "dept_id", "post_ids", "email", "mobile", "sex", "avatar", "status", "login_ip", "login_date", "creator", "create_time", "updater", "update_time", "deleted", "tenant_id") VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/48934f2f-92d4-4250-b917-d10d2b262c6a', 0, '127.0.0.1', '2022-05-13 00:56:52.659', 'admin', '2021-01-05 17:03:47', NULL, '2022-05-13 00:56:52.662', 0, 1); +INSERT INTO "system_users" ("id", "username", "password", "nickname", "remark", "dept_id", "post_ids", "email", "mobile", "sex", "avatar", "status", "login_ip", "login_date", "creator", "create_time", "updater", "update_time", "deleted", "tenant_id") VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/48934f2f-92d4-4250-b917-d10d2b262c6a', 0, '127.0.0.1', '2022-05-25 23:44:33.003', 'admin', '2021-01-05 17:03:47', NULL, '2022-05-25 23:44:33.003', 0, 1); COMMIT; -- ---------------------------- @@ -4521,12 +4500,12 @@ SELECT setval('"bpm_task_assign_rule_seq"', 1, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"infra_api_access_log_seq"', 434, true); +SELECT setval('"infra_api_access_log_seq"', 537, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"infra_api_error_log_seq"', 66, true); +SELECT setval('"infra_api_error_log_seq"', 73, true); -- ---------------------------- -- Alter sequences owned by @@ -4621,12 +4600,12 @@ SELECT setval('"infra_job_seq"', 2, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"system_error_code_seq"', 175, true); +SELECT setval('"system_error_code_seq"', 186, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"system_login_log_seq"', 18, true); +SELECT setval('"system_login_log_seq"', 23, true); -- ---------------------------- -- Alter sequences owned by @@ -4639,7 +4618,7 @@ SELECT setval('"system_login_log_seq"', 18, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"system_oauth2_access_token_seq"', 4, true); +SELECT setval('"system_oauth2_access_token_seq"', 11, true); -- ---------------------------- -- Alter sequences owned by @@ -4654,7 +4633,7 @@ SELECT setval('"system_oauth2_refresh_token_seq"', 1, true); -- ---------------------------- -- Alter sequences owned by -- ---------------------------- -SELECT setval('"system_operate_log_seq"', 39, true); +SELECT setval('"system_operate_log_seq"', 44, true); -- ---------------------------- -- Alter sequences owned by @@ -4717,11 +4696,6 @@ SELECT setval('"system_sms_log_seq"', 1, true); -- Alter sequences owned by -- ---------------------------- --- ---------------------------- --- Primary Key structure for table act_evt_log --- ---------------------------- -ALTER TABLE "act_evt_log" ADD CONSTRAINT "act_evt_log_pkey" PRIMARY KEY ("log_nr_"); - -- ---------------------------- -- Primary Key structure for table bpm_form -- ---------------------------- diff --git a/sql/sqlserver/ruoyi-vue-pro.sql b/sql/sqlserver/ruoyi-vue-pro.sql index 0a0ce8844..d6bd1847c 100644 --- a/sql/sqlserver/ruoyi-vue-pro.sql +++ b/sql/sqlserver/ruoyi-vue-pro.sql @@ -12,7 +12,7 @@ Target Server Version : 15004198 File Encoding : 65001 - Date: 17/05/2022 09:46:25 + Date: 15/06/2022 08:15:45 */ @@ -333,3 +333,12039 @@ GO ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] SET (LOCK_ESCALATION = TABLE) GO + +-- ---------------------------- +-- Records of QRTZ_SIMPROP_TRIGGERS +-- ---------------------------- +BEGIN TRANSACTION +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for QRTZ_TRIGGERS +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND type IN ('U')) + DROP TABLE [dbo].[QRTZ_TRIGGERS] +GO + +CREATE TABLE [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME] varchar(120) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [TRIGGER_NAME] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [TRIGGER_GROUP] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [JOB_NAME] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [JOB_GROUP] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [DESCRIPTION] varchar(250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [NEXT_FIRE_TIME] bigint NULL, + [PREV_FIRE_TIME] bigint NULL, + [PRIORITY] int NULL, + [TRIGGER_STATE] varchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [TRIGGER_TYPE] varchar(8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [START_TIME] bigint NOT NULL, + [END_TIME] bigint NULL, + [CALENDAR_NAME] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [MISFIRE_INSTR] smallint NULL, + [JOB_DATA] varbinary(max) NULL +) +GO + +ALTER TABLE [dbo].[QRTZ_TRIGGERS] SET (LOCK_ESCALATION = TABLE) +GO + + +-- ---------------------------- +-- Records of QRTZ_TRIGGERS +-- ---------------------------- +BEGIN TRANSACTION +GO + +INSERT INTO [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP], [JOB_NAME], [JOB_GROUP], [DESCRIPTION], [NEXT_FIRE_TIME], [PREV_FIRE_TIME], [PRIORITY], [TRIGGER_STATE], [TRIGGER_TYPE], [START_TIME], [END_TIME], [CALENDAR_NAME], [MISFIRE_INSTR], [JOB_DATA]) VALUES (N'schedulerName', N'userSessionTimeoutJob', N'DEFAULT', N'userSessionTimeoutJob', N'DEFAULT', NULL, N'1651484640000', N'1651484580000', N'5', N'WAITING', N'CRON', N'1651483728000', N'0', NULL, N'0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000037400114A4F425F48414E444C45525F504152414D707400124A4F425F52455452595F494E54455256414C737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000374000F4A4F425F52455452595F434F554E547371007E0009000007D07800) +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_form +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_form]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_form] +GO + +CREATE TABLE [dbo].[bpm_form] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [conf] nvarchar(1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [fields] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_form] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单名', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单的配置', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'conf' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单项的数组', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'fields' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'工作流的表单定义', +'SCHEMA', N'dbo', +'TABLE', N'bpm_form' +GO + + +-- ---------------------------- +-- Records of bpm_form +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_form] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_form] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_oa_leave +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_oa_leave]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_oa_leave] +GO + +CREATE TABLE [dbo].[bpm_oa_leave] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [type] tinyint NOT NULL, + [reason] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [start_time] datetime2(7) NOT NULL, + [end_time] datetime2(7) NOT NULL, + [day] tinyint NOT NULL, + [result] tinyint NOT NULL, + [process_instance_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_oa_leave] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请假表单主键', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'申请人的用户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请假类型', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请假原因', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'reason' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开始时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'start_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结束时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'end_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请假天数', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'day' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请假结果', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'process_instance_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'OA 请假申请表', +'SCHEMA', N'dbo', +'TABLE', N'bpm_oa_leave' +GO + + +-- ---------------------------- +-- Records of bpm_oa_leave +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_oa_leave] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_oa_leave] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_process_definition_ext +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_process_definition_ext]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_process_definition_ext] +GO + +CREATE TABLE [dbo].[bpm_process_definition_ext] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [process_definition_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [model_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [description] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [form_type] tinyint NOT NULL, + [form_id] bigint NULL, + [form_conf] nvarchar(1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [form_fields] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [form_custom_create_path] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [form_custom_view_path] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_process_definition_ext] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程定义的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'process_definition_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程模型的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'model_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'描述', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'description' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单类型', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单的配置', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_conf' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单项的数组', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_fields' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自定义表单的提交路径', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_custom_create_path' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自定义表单的查看路径', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'form_custom_view_path' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Bpm 流程定义的拓展表 +', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_definition_ext' +GO + + +-- ---------------------------- +-- Records of bpm_process_definition_ext +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_process_definition_ext] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_process_definition_ext] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_process_instance_ext +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_process_instance_ext]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_process_instance_ext] +GO + +CREATE TABLE [dbo].[bpm_process_instance_ext] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [start_user_id] bigint NOT NULL, + [name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [process_instance_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [process_definition_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [category] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [result] tinyint NOT NULL, + [end_time] datetime2(7) NULL, + [form_variables] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_process_instance_ext] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发起流程的用户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'start_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的名字', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'process_instance_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程定义的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'process_definition_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程分类', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'category' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的状态', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的结果', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结束时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'end_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表单值', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'form_variables' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'工作流的流程实例的拓展', +'SCHEMA', N'dbo', +'TABLE', N'bpm_process_instance_ext' +GO + + +-- ---------------------------- +-- Records of bpm_process_instance_ext +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_process_instance_ext] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_process_instance_ext] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_task_assign_rule +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_task_assign_rule]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_task_assign_rule] +GO + +CREATE TABLE [dbo].[bpm_task_assign_rule] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [model_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [process_definition_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [task_definition_key] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] tinyint NOT NULL, + [options] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_task_assign_rule] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程模型的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'model_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程定义的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'process_definition_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程任务定义的 key', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'task_definition_key' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'规则类型', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'规则值,JSON 数组', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'options' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Bpm 任务规则表', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_assign_rule' +GO + + +-- ---------------------------- +-- Records of bpm_task_assign_rule +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_task_assign_rule] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_task_assign_rule] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_task_ext +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_task_ext]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_task_ext] +GO + +CREATE TABLE [dbo].[bpm_task_ext] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [assignee_user_id] bigint NULL, + [name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [task_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [result] tinyint NOT NULL, + [reason] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [end_time] datetime2(7) NULL, + [process_instance_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [process_definition_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_task_ext] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务的审批人', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'assignee_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务的名字', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'task_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务的结果', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'审批建议', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'reason' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务的结束时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'end_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程实例的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'process_instance_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'流程定义的编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'process_definition_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'工作流的流程任务的拓展表', +'SCHEMA', N'dbo', +'TABLE', N'bpm_task_ext' +GO + + +-- ---------------------------- +-- Records of bpm_task_ext +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_task_ext] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_task_ext] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for bpm_user_group +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bpm_user_group]') AND type IN ('U')) + DROP TABLE [dbo].[bpm_user_group] +GO + +CREATE TABLE [dbo].[bpm_user_group] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [description] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [member_user_ids] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[bpm_user_group] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'组名', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'描述', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'description' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'成员编号数组', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'member_user_ids' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户组', +'SCHEMA', N'dbo', +'TABLE', N'bpm_user_group' +GO + + +-- ---------------------------- +-- Records of bpm_user_group +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[bpm_user_group] ON +GO + +SET IDENTITY_INSERT [dbo].[bpm_user_group] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for dual +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[dual]') AND type IN ('U')) + DROP TABLE [dbo].[dual] +GO + +CREATE TABLE [dbo].[dual] ( + [id] int NULL +) +GO + +ALTER TABLE [dbo].[dual] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据库连接的表', +'SCHEMA', N'dbo', +'TABLE', N'dual' +GO + + +-- ---------------------------- +-- Records of dual +-- ---------------------------- +BEGIN TRANSACTION +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_api_access_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_api_access_log]') AND type IN ('U')) + DROP TABLE [dbo].[infra_api_access_log] +GO + +CREATE TABLE [dbo].[infra_api_access_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [trace_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_id] bigint DEFAULT 0 NOT NULL, + [user_type] tinyint DEFAULT 0 NOT NULL, + [application_name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_method] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_url] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_params] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_agent] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [begin_time] datetime2(7) NOT NULL, + [end_time] datetime2(7) NOT NULL, + [duration] int NOT NULL, + [result_code] int NOT NULL, + [result_msg] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_api_access_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'链路追踪编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'trace_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用名', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'application_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求方法名', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'request_method' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求地址', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'request_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求参数', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'request_params' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'浏览器 UA', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'user_agent' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开始请求时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'begin_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结束请求时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'end_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'执行时长', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'duration' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果码', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'result_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果提示', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'result_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'API 访问日志表', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_access_log' +GO + + +-- ---------------------------- +-- Records of infra_api_access_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_api_access_log] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_api_access_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_api_error_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_api_error_log]') AND type IN ('U')) + DROP TABLE [dbo].[infra_api_error_log] +GO + +CREATE TABLE [dbo].[infra_api_error_log] ( + [id] int IDENTITY(1,1) NOT NULL, + [trace_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_id] int DEFAULT 0 NOT NULL, + [user_type] tinyint DEFAULT 0 NOT NULL, + [application_name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_method] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_url] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [request_params] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_agent] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_time] datetime2(7) NOT NULL, + [exception_name] nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_message] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_root_cause_message] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_stack_trace] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_class_name] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_file_name] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_method_name] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [exception_line_number] int NOT NULL, + [process_status] tinyint NOT NULL, + [process_time] datetime2(7) NULL, + [process_user_id] int NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_api_error_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'链路追踪编号 + * + * 一般来说,通过链路追踪编号,可以将访问日志,错误日志,链路追踪日志,logger 打印日志等,结合在一起,从而进行排错。', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'trace_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用名 + * + * 目前读取 spring.application.name', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'application_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求方法名', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'request_method' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求地址', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'request_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求参数', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'request_params' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'浏览器 UA', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'user_agent' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常发生时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常名 + * + * {@link Throwable#getClass()} 的类全名', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常导致的消息 + * + * {@link cn.iocoder.common.framework.util.ExceptionUtil#getMessage(Throwable)}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_message' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常导致的根消息 + * + * {@link cn.iocoder.common.framework.util.ExceptionUtil#getRootCauseMessage(Throwable)}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_root_cause_message' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常的栈轨迹 + * + * {@link cn.iocoder.common.framework.util.ExceptionUtil#getServiceException(Exception)}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_stack_trace' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常发生的类全名 + * + * {@link StackTraceElement#getClassName()}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_class_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常发生的类文件 + * + * {@link StackTraceElement#getFileName()}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_file_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常发生的方法名 + * + * {@link StackTraceElement#getMethodName()}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_method_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异常发生的方法所在行 + * + * {@link StackTraceElement#getLineNumber()}', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'exception_line_number' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理状态', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'process_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'process_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理用户编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'process_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'系统异常日志', +'SCHEMA', N'dbo', +'TABLE', N'infra_api_error_log' +GO + + +-- ---------------------------- +-- Records of infra_api_error_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_api_error_log] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_api_error_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_codegen_column +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_codegen_column]') AND type IN ('U')) + DROP TABLE [dbo].[infra_codegen_column] +GO + +CREATE TABLE [dbo].[infra_codegen_column] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [table_id] bigint NOT NULL, + [column_name] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [data_type] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [column_comment] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [nullable] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [primary_key] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [auto_increment] nchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [ordinal_position] int NOT NULL, + [java_type] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [java_field] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [dict_type] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [example] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_operation] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [update_operation] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [list_operation] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [list_operation_condition] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [list_operation_result] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [html_type] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_codegen_column] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'table_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字段名', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'column_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字段类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'data_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字段描述', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'column_comment' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否允许为空', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'nullable' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否主键', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'primary_key' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否自增', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'auto_increment' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'ordinal_position' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Java 属性类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'java_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Java 属性名', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'java_field' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'dict_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据示例', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'example' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否为 Create 创建操作的字段', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'create_operation' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否为 Update 更新操作的字段', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'update_operation' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否为 List 查询操作的字段', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'list_operation' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'List 查询操作的条件类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'list_operation_condition' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否为 List 查询操作的返回字段', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'list_operation_result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'显示类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'html_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'代码生成表字段定义', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_column' +GO + + +-- ---------------------------- +-- Records of infra_codegen_column +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_codegen_column] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_codegen_column] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_codegen_table +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_codegen_table]') AND type IN ('U')) + DROP TABLE [dbo].[infra_codegen_table] +GO + +CREATE TABLE [dbo].[infra_codegen_table] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [data_source_config_id] bigint NOT NULL, + [scene] tinyint NOT NULL, + [table_name] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [table_comment] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [module_name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [business_name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [class_name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [class_comment] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [author] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [template_type] tinyint NOT NULL, + [parent_menu_id] bigint NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_codegen_table] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据源配置的编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'data_source_config_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'生成场景', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'scene' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表名称', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'table_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'表描述', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'table_comment' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模块名', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'module_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'业务名', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'business_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'类名称', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'class_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'类描述', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'class_comment' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'作者', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'author' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'template_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'父菜单编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'parent_menu_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'代码生成表定义', +'SCHEMA', N'dbo', +'TABLE', N'infra_codegen_table' +GO + + +-- ---------------------------- +-- Records of infra_codegen_table +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_codegen_table] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_codegen_table] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_config +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_config]') AND type IN ('U')) + DROP TABLE [dbo].[infra_config] +GO + +CREATE TABLE [dbo].[infra_config] ( + [id] int NOT NULL, + [category] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] tinyint NOT NULL, + [name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [config_key] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [value] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [visible] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_config] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数主键', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数分组', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'category' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数名称', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数键名', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'config_key' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数键值', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'value' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否可见', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'visible' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_config', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数配置表', +'SCHEMA', N'dbo', +'TABLE', N'infra_config' +GO + + +-- ---------------------------- +-- Records of infra_config +-- ---------------------------- +BEGIN TRANSACTION +GO + +INSERT INTO [dbo].[infra_config] ([id], [category], [type], [name], [config_key], [value], [visible], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'ui', N'1', N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'0', N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-03-26 23:10:31.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_config] ([id], [category], [type], [name], [config_key], [value], [visible], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'biz', N'1', N'用户管理-账号初始密码', N'sys.user.init-password', N'123456', N'0', N'初始化密码 123456', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-03-20 02:25:51.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_config] ([id], [category], [type], [name], [config_key], [value], [visible], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'3', N'ui', N'1', N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'0', N'深色主题theme-dark,浅色主题theme-light', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2021-01-19 03:05:21.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_config] ([id], [category], [type], [name], [config_key], [value], [visible], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'6', N'biz', N'2', N'登陆验证码的开关', N'yudao.captcha.enable', N'true', N'1', NULL, N'1', N'2022-02-17 00:03:11.0000000', N'1', N'2022-04-04 12:51:40.0000000', N'0') +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_data_source_config +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_data_source_config]') AND type IN ('U')) + DROP TABLE [dbo].[infra_data_source_config] +GO + +CREATE TABLE [dbo].[infra_data_source_config] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [username] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [password] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_data_source_config] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'主键编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数名称', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据源连接', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户名', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'username' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'密码', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'password' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据源配置表', +'SCHEMA', N'dbo', +'TABLE', N'infra_data_source_config' +GO + + +-- ---------------------------- +-- Records of infra_data_source_config +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_data_source_config] ON +GO + +INSERT INTO [dbo].[infra_data_source_config] ([id], [name], [url], [username], [password], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'8', N'test', N'jdbc:mysql://127.0.0.1:3306/testb5f4', N'root', N'3xgHTSHmF3mlgL3Ybw45ztewGDxGgEkWF3wTSYey7k+uXI/wdz45TrvYvYssQtmA', N'1', N'2022-04-27 22:48:20.0000000', N'1', N'2022-04-28 20:04:06.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_data_source_config] ([id], [name], [url], [username], [password], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'9', N'oracle_test', N'jdbc:oracle:thin:@127.0.0.1:1521:xe', N'root', N'vwmNAPLiEi+NX4AVdC+zNvpejPLwcFXp6dlhgNxCfDTi4vKRy76iIeFqyvpRerNC', N'1', N'2022-04-28 20:41:26.0000000', N'1', N'2022-04-28 20:41:26.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[infra_data_source_config] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_file +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_file]') AND type IN ('U')) + DROP TABLE [dbo].[infra_file] +GO + +CREATE TABLE [dbo].[infra_file] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [config_id] bigint NULL, + [path] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [size] int NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [name] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[infra_file] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'配置编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'config_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件路径', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'path' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件 URL', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件大小', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'size' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件路径', +'SCHEMA', N'dbo', +'TABLE', N'infra_file', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件表', +'SCHEMA', N'dbo', +'TABLE', N'infra_file' +GO + + +-- ---------------------------- +-- Records of infra_file +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_file] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_file] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_file_config +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_file_config]') AND type IN ('U')) + DROP TABLE [dbo].[infra_file_config] +GO + +CREATE TABLE [dbo].[infra_file_config] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [storage] tinyint NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [master] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [config] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_file_config] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'配置名', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'存储器', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'storage' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否为主配置', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'master' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'存储配置', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'config' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件配置表', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_config' +GO + + +-- ---------------------------- +-- Records of infra_file_config +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_file_config] ON +GO + +INSERT INTO [dbo].[infra_file_config] ([id], [name], [storage], [remark], [master], [config], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'4', N'数据库', N'1', N'我是数据库', N'0', N'{"@class":"cn.iocoder.yudao.framework.file.core.client.db.DBFileClientConfig","domain":"http://127.0.0.1:48080"}', N'1', N'2022-03-15 23:56:24.0000000', N'1', N'2022-03-26 21:39:26.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_file_config] ([id], [name], [storage], [remark], [master], [config], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'5', N'本地磁盘', N'10', N'测试下本地存储', N'0', N'{"@class":"cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig","basePath":"/Users/yunai/file_test","domain":"http://127.0.0.1:48080"}', N'1', N'2022-03-15 23:57:00.0000000', N'1', N'2022-03-26 21:39:26.0000000', N'0') +GO + +INSERT INTO [dbo].[infra_file_config] ([id], [name], [storage], [remark], [master], [config], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'11', N'S3 - 七牛云', N'20', NULL, N'1', N'{"@class":"cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig","endpoint":"s3-cn-south-1.qiniucs.com","domain":"http://test.yudao.iocoder.cn","bucket":"ruoyi-vue-pro","accessKey":"b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8","accessSecret":"kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP"}', N'1', N'2022-03-19 18:00:03.0000000', N'1', N'2022-03-26 21:39:26.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[infra_file_config] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_file_content +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_file_content]') AND type IN ('U')) + DROP TABLE [dbo].[infra_file_content] +GO + +CREATE TABLE [dbo].[infra_file_content] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [config_id] bigint NOT NULL, + [path] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [content] varbinary(max) NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_file_content] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'配置编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'config_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件路径', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'path' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件内容', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'文件表', +'SCHEMA', N'dbo', +'TABLE', N'infra_file_content' +GO + + +-- ---------------------------- +-- Records of infra_file_content +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_file_content] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_file_content] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_job +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_job]') AND type IN ('U')) + DROP TABLE [dbo].[infra_job] +GO + +CREATE TABLE [dbo].[infra_job] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [handler_name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [handler_param] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [cron_expression] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [retry_count] int NOT NULL, + [retry_interval] int NOT NULL, + [monitor_timeout] int NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_job] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务名称', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务状态', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理器的名字', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'handler_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理器的参数', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'handler_param' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'CRON 表达式', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'cron_expression' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'重试次数', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'retry_count' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'重试间隔', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'retry_interval' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'监控超时时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'monitor_timeout' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_job', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'定时任务表', +'SCHEMA', N'dbo', +'TABLE', N'infra_job' +GO + + +-- ---------------------------- +-- Records of infra_job +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_job] ON +GO + +INSERT INTO [dbo].[infra_job] ([id], [name], [status], [handler_name], [handler_param], [cron_expression], [retry_count], [retry_interval], [monitor_timeout], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'16', N'用户 Session 超时 Job', N'1', N'userSessionTimeoutJob', NULL, N'0 * * * * ? *', N'2000', N'3', N'0', N'1', N'2022-05-02 17:28:48.8850000', N'1', N'2022-05-02 17:28:49.0240000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[infra_job] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_job_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_job_log]') AND type IN ('U')) + DROP TABLE [dbo].[infra_job_log] +GO + +CREATE TABLE [dbo].[infra_job_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [job_id] bigint NOT NULL, + [handler_name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [handler_param] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [execute_index] tinyint NOT NULL, + [begin_time] datetime2(7) NOT NULL, + [end_time] datetime2(7) NULL, + [duration] int NULL, + [status] tinyint NOT NULL, + [result] nvarchar(4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_job_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'日志编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'job_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理器的名字', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'handler_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'处理器的参数', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'handler_param' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'第几次执行', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'execute_index' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开始执行时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'begin_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结束执行时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'end_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'执行时长', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'duration' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务状态', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果数据', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'定时任务日志表', +'SCHEMA', N'dbo', +'TABLE', N'infra_job_log' +GO + + +-- ---------------------------- +-- Records of infra_job_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_job_log] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_job_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for infra_test_demo +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[infra_test_demo]') AND type IN ('U')) + DROP TABLE [dbo].[infra_test_demo] +GO + +CREATE TABLE [dbo].[infra_test_demo] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [type] tinyint NOT NULL, + [category] tinyint NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[infra_test_demo] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'名字', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'类型', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'分类', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'category' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型表', +'SCHEMA', N'dbo', +'TABLE', N'infra_test_demo' +GO + + +-- ---------------------------- +-- Records of infra_test_demo +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[infra_test_demo] ON +GO + +SET IDENTITY_INSERT [dbo].[infra_test_demo] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for member_user +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[member_user]') AND type IN ('U')) + DROP TABLE [dbo].[member_user] +GO + +CREATE TABLE [dbo].[member_user] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [nickname] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [avatar] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [mobile] nvarchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [password] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [register_ip] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [login_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [login_date] datetime2(7) NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[member_user] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户昵称', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'nickname' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'头像', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'avatar' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'mobile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'密码', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'password' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'注册 IP', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'register_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后登录IP', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'login_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后登录时间', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'login_date' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'member_user', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户', +'SCHEMA', N'dbo', +'TABLE', N'member_user' +GO + + +-- ---------------------------- +-- Records of member_user +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[member_user] ON +GO + +SET IDENTITY_INSERT [dbo].[member_user] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_app +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_app]') AND type IN ('U')) + DROP TABLE [dbo].[pay_app] +GO + +CREATE TABLE [dbo].[pay_app] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [pay_notify_url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [refund_notify_url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [merchant_id] bigint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_app] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用名', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付结果的回调地址', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'pay_notify_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款结果的回调地址', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'refund_notify_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'merchant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_app', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付应用信息', +'SCHEMA', N'dbo', +'TABLE', N'pay_app' +GO + + +-- ---------------------------- +-- Records of pay_app +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_app] ON +GO + +INSERT INTO [dbo].[pay_app] ([id], [name], [status], [remark], [pay_notify_url], [refund_notify_url], [merchant_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'6', N'芋道', N'0', N'我是一个公众号', N'http://127.0.0.1:28080/api/shop/order/pay-notify', N'http://127.0.0.1', N'1', N'', N'2021-10-23 08:49:25.0000000', N'', N'2022-02-27 04:14:53.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[pay_app] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_channel +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_channel]') AND type IN ('U')) + DROP TABLE [dbo].[pay_channel] +GO + +CREATE TABLE [dbo].[pay_channel] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [code] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [fee_rate] float(53) NOT NULL, + [merchant_id] bigint NOT NULL, + [app_id] bigint NOT NULL, + [config] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_channel] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道费率,单位:百分比', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'fee_rate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'merchant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'app_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付渠道配置', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'config' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付渠道 +', +'SCHEMA', N'dbo', +'TABLE', N'pay_channel' +GO + + +-- ---------------------------- +-- Records of pay_channel +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_channel] ON +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'9', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-10-23 17:12:10.0000000', NULL, N'2022-02-27 04:15:13.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'10', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-14 22:01:24.0000000', NULL, N'2022-02-27 04:15:12.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'11', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-14 22:02:57.0000000', NULL, N'2022-02-27 04:15:11.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'12', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-14 22:06:10.0000000', NULL, N'2022-02-27 04:15:09.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'13', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-14 22:09:39.0000000', NULL, N'2022-02-27 04:15:08.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'14', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-14 22:38:49.0000000', NULL, N'2022-02-27 04:15:05.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'15', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2021-12-15 09:32:26.0000000', NULL, N'2022-02-27 04:15:04.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'16', N'wx_pub', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig","appId":"wx041349c6f39b268b","mchId":"1545083881","apiVersion":"v2","mchKey":"0alL64UDQdlCwiKZ73ib7ypaIjMns06p","privateKeyContent":"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5q2hYE3loOQoH\nl/2kh/epuj17W8VpV5vBl7ysJWAbBXux6mlq4gKTHD0QUQdiKtDEUm/bKC9Bi6VU\nuklM5Y8oCaCbhjklHRbET8jsgd9phSNGviHclYRLsQRO8oXnN89kN0y7DYKm0hYd\nmaiS12Z3v8VaImSTr4HVeHlC/z3S6mdwSr263stKt931YTcbTj/QFH7znsv9Na0u\nX6LaMBEEAsJctWdm8Ndrd1tGh9Fzf0DA5VRXsJR3kkWspy+IwiDTPV/FDKOU9NJC\nSxMmDePerTfkoZ2s1rltqBK0ykDJrXtxR+hTzEsKZ/KpNi8tyYpfNZsviHIlUsLP\nFJ5UvUhpAgMBAAECggEAd90NltazqTIxpGdeCwrwOzWNnYbIclJprlhMKIJUgf1P\nNrPTbHoOGXTAgzkcYCat8iAaMEzH/TOu/3zn92m3uqxEcEL9v1UBLqknWHAbkB6w\ngGocqDAqYUcdNe5hvbyM+fCta5C0SQgV2PQrHOlMMICwYpkTfzhtxCdreXIYMoGg\nJEIRkZWgrm/N7LTtNgizznuUjy6OURWjXaWKPcs3b3j6G1gLj9Vp++z4y0u51nqM\n4R6fcvl8M6BjlcC8zo6DbOvCW8cXtuXsnru+2TPrUnsGeybJok4fEQsfW1BvpvPo\nief38rYJn4OWxIrHcpWrhNtXtgRPeiMGFfIsEQDmVQKBgQDzXK6Nn3Nr3TFfGVTy\n8QYrzOuY2NqzH8nnsLL6qn3HoKxTv+PcFKOTPsi6f4hIYCzBP0esRrPv0ffMu9oQ\nJvFtCJvMmcKGtp0Q5hcj0y/XkbC3AWuahJtBv8lhKXVnQXSL0j3+ombljw4/8yN0\nAzgBz+j/skQQgZ3sN5h+DHGtgwKBgQDDT784/2pd4m86c/uBmrwYfqu6MJo0eHJh\n1XPtE+u8pOHyNTFk77rKobKDqN5VlrF0uEmBc/08LKhyxJ3vh/zAbcmqT1Mq778y\nAKKUtVmvcaVDrvSQHsnhj0zt4SHGmmU34U2b9hV+nocq5VszX6/jp//HJi9bs3We\ndAzfFCmaowKBgC1MmDVGc+6lCraf+X8LPFHU4Bnga70h8qxM6NPd/nG1R76DHn/t\n25DiA+0rJgwK0unZxJadxoqic9TJNssA5Lmd+5o3GM2Imm311mLVwbcHqHQ4MHZf\nrqKrd2m9lNv2hCIurVmDk1Gxsj5XHMdQfhFgSQengCHubp30r07vNA3PAoGAUEAE\nIjdQTSMs8KeXP7mEb8wcY3R05/pVhT1fVJpK0kgtTofss7yM05V88/v+3sv8Pik6\niqZN9tuimwWOn00Q3UA/DGtrkMjRlooMQ24AW8YmUZkhg9YivTtUMKnAZwopbLx2\nVw7V5iDdCRMUVheK/c+ZmQpnixZBzcmBQGfYcGECgYBjEq3Mem+Aw6pXOu6+0FwH\n9y6Xi4HhBkq0OOZZuXFtWVry7YrD3pBgzWVAZJqJCkyPKKZzCzwdbFd3u0lYBs35\nzYgx7ug4hR+wfI980a3vxjcWGOqnOUUnUJ7ucIa+KDgnYV/bBy4jqpVreXmWAJXl\nfyjG3eLWBrtrsI9YX6zeAA==\n-----END PRIVATE KEY-----\n","privateCertContent":"-----BEGIN CERTIFICATE-----\nMIID6TCCAtGgAwIBAgIUNkEHq6aQcF80NSYqWS58ybsJzI4wDQYJKoZIhvcNAQEL\nBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT\nFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg\nQ0EwHhcNMjExMDIxMDU0NTQxWhcNMjYxMDIwMDU0NTQxWjB7MRMwEQYDVQQDDAox\nNTQ1MDgzODgxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM\nHuWOhuWfjuWMuuWkp+adjuWwp+aXpeeUqOWTgeW6lzELMAkGA1UEBgwCQ04xETAP\nBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\nuatoWBN5aDkKB5f9pIf3qbo9e1vFaVebwZe8rCVgGwV7seppauICkxw9EFEHYirQ\nxFJv2ygvQYulVLpJTOWPKAmgm4Y5JR0WxE/I7IHfaYUjRr4h3JWES7EETvKF5zfP\nZDdMuw2CptIWHZmoktdmd7/FWiJkk6+B1Xh5Qv890upncEq9ut7LSrfd9WE3G04/\n0BR+857L/TWtLl+i2jARBALCXLVnZvDXa3dbRofRc39AwOVUV7CUd5JFrKcviMIg\n0z1fxQyjlPTSQksTJg3j3q035KGdrNa5bagStMpAya17cUfoU8xLCmfyqTYvLcmK\nXzWbL4hyJVLCzxSeVL1IaQIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMC\nBPAwZQYDVR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1\nYmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMw\nMUMzRThFQkQyMA0GCSqGSIb3DQEBCwUAA4IBAQBe7XgncAY/1PLbCsnMsYt11k3V\n2cdNZ+yuCxhlOEKk3nHE6WCTL6zL0qWlTKKpnw1rE/+4OS76Tg72wWXcHfHDAOgt\n9icp62cKx1WO3QweeZpSvLDmtdLgKKrqeIWh+rL8+ZhuAOxSkaRwcsMTWDaLeDOi\n0pGeqvfG8WNhPxkkaSI8xbiTK641Yg9WT/Q4yfHS7Q6wg1dj9YQdo0dvVB0S2Nir\nX9IK6PUaHDnQeFKDmKgLkDGLaKaiijEvC91wMEE6qB8b0eNhciaxq2YhGHcFmSRP\nWUyc5CmBadt7wIOH5Z3bfuwWGxqxKjNw/baM/d+nk7hlDr01YL9c0g16B9MW\n-----END CERTIFICATE-----\n","apiV3Key":"joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"}', NULL, N'2022-01-31 22:13:25.0000000', NULL, N'2022-02-27 04:15:03.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[pay_channel] ([id], [code], [status], [remark], [fee_rate], [merchant_id], [app_id], [config], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'17', N'alipay_qr', N'0', NULL, N'1', N'1', N'6', N'{"@class":"cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig","serverUrl":"https://openapi.alipaydev.com/gateway.do","appId":"2021000118634035","signType":"RSA2","mode":null,"privateKey":"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJv890x84qbppUtRIfhaKSwSVN0thCcsDCaAsGR5MZslDkO8NCT9V4r2SVXjyY7eJUZlZd1M0C8T01Tg4UOx5LUbic0O3A1uJMy6V1n9IyYwbAW3AEZhBd5bSbPgrqvmv3NeWSTQT6Anxnllf+2iDH6zyA2fPl7cYyQtbZoDJQFGqr4F+cGh2R6akzRKNoBkAeMYwoY6es2lX8sJxCVPWUmxNUoL3tScwlSpd7Bxw0q9c/X01jMwuQ0+Va358zgFiGERTE6yD01eu40OBDXOYO3z++y+TAYHlQQ2toMO63trepo88X3xV3R44/1DH+k2pAm2IF5ixiLrAgMBAAECggEAPx3SoXcseaD7rmcGcE0p4SMfbsUDdkUSmBBbtfF0GzwnqNLkWa+mgE0rWt9SmXngTQH97vByAYmLPl1s3G82ht1V7Sk7yQMe74lhFllr8eEyTjeVx3dTK1EEM4TwN+936DTXdFsr4TELJEcJJdD0KaxcCcfBLRDs2wnitEFZ9N+GoZybVmY8w0e0MI7PLObUZ2l0X4RurQnfG9ZxjXjC7PkeMVv7cGGylpNFi3BbvkRhdhLPDC2E6wqnr9e7zk+hiENivAezXrtxtwKovzCtnWJ1r0IO14Rh47H509Ic0wFnj+o5YyUL4LdmpL7yaaH6fM7zcSLFjNZPHvZCKPwYcQKBgQDQFho98QvnL8ex4v6cry4VitGpjSXm1qP3vmMQk4rTsn8iPWtcxPjqGEqOQJjdi4Mi0VZKQOLFwlH0kl95wNrD/isJ4O1yeYfX7YAXApzHqYNINzM79HemO3Yx1qLMW3okRFJ9pPRzbQ9qkTpsaegsmyX316zOBhzGRYjKbutTYwKBgQCm7phr9XdFW5Vh+XR90mVs483nrLmMiDKg7YKxSLJ8amiDjzPejCn7i95Hah08P+2MIZLIPbh2VLacczR6ltRRzN5bg5etFuqSgfkuHyxpoDmpjbe08+Q2h8JBYqcC5Nhv1AKU4iOUhVLHo/FBAQliMcGc/J3eiYTFC7EsNx382QKBgClb20doe7cttgFTXswBvaUmfFm45kmla924B7SpvrQpDD/f+VDtDZRp05fGmxuduSjYdtA3aVtpLiTwWu22OUUvZZqHDGruYOO4Hvdz23mL5b4ayqImCwoNU4bAZIc9v18p/UNf3/55NNE3oGcf/bev9rH2OjCQ4nM+Ktwhg8CFAoGACSgvbkShzUkv0ZcIf9ppu+ZnJh1AdGgINvGwaJ8vQ0nm/8h8NOoFZ4oNoGc+wU5Ubops7dUM6FjPR5e+OjdJ4E7Xp7d5O4J1TaIZlCEbo5OpdhaTDDcQvrkFu+Z4eN0qzj+YAKjDAOOrXc4tbr5q0FsgXscwtcNfaBuzFVTUrUkCgYEAwzPnMNhWG3zOWLUs2QFA2GP4Y+J8cpUYfj6pbKKzeLwyG9qBwF1NJpN8m+q9q7V9P2LY+9Lp9e1mGsGeqt5HMEA3P6vIpcqLJLqE/4PBLLRzfccTcmqb1m71+erxTRhHBRkGS+I7dZEb3olQfnS1Y1tpMBxiwYwR3LW4oXuJwj8=","alipayPublicKey":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB","appCertContent":null,"alipayPublicCertContent":null,"rootCertContent":null}', NULL, N'2022-01-31 22:13:25.0000000', NULL, N'2022-02-27 04:15:02.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[pay_channel] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_merchant +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_merchant]') AND type IN ('U')) + DROP TABLE [dbo].[pay_merchant] +GO + +CREATE TABLE [dbo].[pay_merchant] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [no] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [short_name] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_merchant] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户号', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户全称', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户简称', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'short_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付商户信息', +'SCHEMA', N'dbo', +'TABLE', N'pay_merchant' +GO + + +-- ---------------------------- +-- Records of pay_merchant +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_merchant] ON +GO + +INSERT INTO [dbo].[pay_merchant] ([id], [no], [name], [short_name], [status], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'M233666999', N'芋道源码', N'芋艿', N'0', N'我是备注', N'', N'2021-10-23 08:31:14.0000000', N'', N'2022-02-27 04:15:20.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[pay_merchant] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_notify_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_notify_log]') AND type IN ('U')) + DROP TABLE [dbo].[pay_notify_log] +GO + +CREATE TABLE [dbo].[pay_notify_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [task_id] bigint NOT NULL, + [notify_times] tinyint NOT NULL, + [response] nvarchar(2048) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_notify_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'日志编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知任务编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'task_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'第几次被通知', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'notify_times' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求参数', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'response' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付通知 App 的日志', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_log' +GO + + +-- ---------------------------- +-- Records of pay_notify_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_notify_log] ON +GO + +SET IDENTITY_INSERT [dbo].[pay_notify_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_notify_task +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_notify_task]') AND type IN ('U')) + DROP TABLE [dbo].[pay_notify_task] +GO + +CREATE TABLE [dbo].[pay_notify_task] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [merchant_id] bigint NOT NULL, + [app_id] bigint NOT NULL, + [type] tinyint NOT NULL, + [data_id] bigint NOT NULL, + [status] tinyint NOT NULL, + [merchant_order_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [next_notify_time] datetime2(7) NOT NULL, + [last_execute_time] datetime2(7) NOT NULL, + [notify_times] tinyint NOT NULL, + [max_notify_times] tinyint NOT NULL, + [notify_url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_notify_task] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'任务编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'merchant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'app_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知类型', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'data_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户订单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'merchant_order_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'下一次通知时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'next_notify_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后一次执行时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'last_execute_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'当前通知次数', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'notify_times' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最大可通知次数', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'max_notify_times' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异步通知地址', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'notify_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户支付、退款等的通知 +', +'SCHEMA', N'dbo', +'TABLE', N'pay_notify_task' +GO + + +-- ---------------------------- +-- Records of pay_notify_task +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_notify_task] ON +GO + +SET IDENTITY_INSERT [dbo].[pay_notify_task] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_order +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_order]') AND type IN ('U')) + DROP TABLE [dbo].[pay_order] +GO + +CREATE TABLE [dbo].[pay_order] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [merchant_id] bigint NOT NULL, + [app_id] bigint NOT NULL, + [channel_id] bigint NULL, + [channel_code] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [merchant_order_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [subject] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [body] nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [notify_url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [notify_status] tinyint NOT NULL, + [amount] bigint NOT NULL, + [channel_fee_rate] float(53) NULL, + [channel_fee_amount] bigint NULL, + [status] tinyint NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [expire_time] datetime2(7) NOT NULL, + [success_time] datetime2(7) NULL, + [notify_time] datetime2(7) NULL, + [success_extension_id] bigint NULL, + [refund_status] tinyint NOT NULL, + [refund_times] tinyint NOT NULL, + [refund_amount] bigint NOT NULL, + [channel_user_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_order_no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_order] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'merchant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'app_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户订单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'merchant_order_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商品标题', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'subject' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商品描述', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'body' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异步通知地址', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'notify_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知商户支付结果的回调状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'notify_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付金额,单位:分', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'amount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道手续费,单位:百分比', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_fee_rate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道手续金额,单位:分', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_fee_amount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'订单失效时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'expire_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'订单支付成功时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'success_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'订单支付通知时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'notify_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付成功的订单拓展单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'success_extension_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'refund_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款次数', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'refund_times' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款总金额,单位:分', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'refund_amount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道用户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道订单号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'channel_order_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_order', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单 +', +'SCHEMA', N'dbo', +'TABLE', N'pay_order' +GO + + +-- ---------------------------- +-- Records of pay_order +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_order] ON +GO + +SET IDENTITY_INSERT [dbo].[pay_order] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_order_extension +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_order_extension]') AND type IN ('U')) + DROP TABLE [dbo].[pay_order_extension] +GO + +CREATE TABLE [dbo].[pay_order_extension] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [order_id] bigint NOT NULL, + [channel_id] bigint NOT NULL, + [channel_code] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [channel_extras] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_notify_data] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_order_extension] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'order_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'channel_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'channel_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付渠道的额外参数', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'channel_extras' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付渠道异步通知的内容', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'channel_notify_data' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单 +', +'SCHEMA', N'dbo', +'TABLE', N'pay_order_extension' +GO + + +-- ---------------------------- +-- Records of pay_order_extension +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_order_extension] ON +GO + +SET IDENTITY_INSERT [dbo].[pay_order_extension] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for pay_refund +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pay_refund]') AND type IN ('U')) + DROP TABLE [dbo].[pay_refund] +GO + +CREATE TABLE [dbo].[pay_refund] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [merchant_id] bigint NOT NULL, + [app_id] bigint NOT NULL, + [channel_id] bigint NOT NULL, + [channel_code] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [order_id] bigint NOT NULL, + [trade_no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [merchant_order_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [merchant_refund_no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [notify_url] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [notify_status] tinyint NOT NULL, + [status] tinyint NOT NULL, + [type] tinyint NOT NULL, + [pay_amount] bigint NOT NULL, + [refund_amount] bigint NOT NULL, + [reason] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_order_no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [channel_refund_no] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_error_code] nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_error_msg] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [channel_extras] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [expire_time] datetime2(7) NULL, + [success_time] datetime2(7) NULL, + [notify_time] datetime2(7) NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[pay_refund] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付退款编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'merchant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'app_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付订单编号 pay_order 表id', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'order_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'交易订单号 pay_extension 表no 字段', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'trade_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户订单编号(商户系统生成)', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'merchant_order_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'商户退款订单号(商户系统生成)', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'merchant_refund_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'异步通知商户地址', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'notify_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知商户退款结果的回调状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'notify_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款状态', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款类型(部分退款,全部退款)', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付金额,单位分', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'pay_amount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款金额,单位分', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'refund_amount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款原因', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'reason' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道订单号,pay_order 中的channel_order_no 对应', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_order_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道退款单号,渠道返回', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_refund_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道调用报错时,错误码', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_error_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道调用报错时,错误信息', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_error_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'支付渠道的额外参数', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'channel_extras' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款失效时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'expire_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款成功时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'success_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款通知时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'notify_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'退款订单', +'SCHEMA', N'dbo', +'TABLE', N'pay_refund' +GO + + +-- ---------------------------- +-- Records of pay_refund +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[pay_refund] ON +GO + +SET IDENTITY_INSERT [dbo].[pay_refund] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_dept +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_dept]') AND type IN ('U')) + DROP TABLE [dbo].[system_dept] +GO + +CREATE TABLE [dbo].[system_dept] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [parent_id] bigint NOT NULL, + [sort] int NOT NULL, + [leader_user_id] bigint NULL, + [phone] nvarchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [email] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_dept] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'部门id', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'部门名称', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'父部门id', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'parent_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'显示顺序', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'sort' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'负责人', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'leader_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系电话', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'phone' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'邮箱', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'email' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'部门状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_dept', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'部门表', +'SCHEMA', N'dbo', +'TABLE', N'system_dept' +GO + + +-- ---------------------------- +-- Records of system_dept +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_dept] ON +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'100', N'芋道源码', N'0', N'0', N'1', N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'103', N'2022-01-14 01:04:05.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'101', N'深圳总公司', N'100', N'1', N'104', N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'1', N'2022-02-22 19:47:48.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'102', N'长沙分公司', N'100', N'2', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'', N'2021-12-15 05:01:40.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'103', N'研发部门', N'101', N'1', N'104', N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'103', N'2022-01-14 01:04:14.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'104', N'市场部门', N'101', N'2', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'', N'2021-12-15 05:01:38.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'105', N'测试部门', N'101', N'3', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'', N'2021-12-15 05:01:37.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'106', N'财务部门', N'101', N'4', N'103', N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'103', N'2022-01-15 21:32:22.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'107', N'运维部门', N'101', N'5', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'', N'2021-12-15 05:01:33.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'108', N'市场部门', N'102', N'1', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'1', N'2022-02-16 08:35:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'109', N'财务部门', N'102', N'2', NULL, N'15888888888', N'ry@qq.com', N'0', N'admin', N'2021-01-05 17:03:47.0000000', N'', N'2021-12-15 05:01:29.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'110', N'新部门', N'0', N'1', NULL, NULL, NULL, N'0', N'110', N'2022-02-23 20:46:30.0000000', N'110', N'2022-02-23 20:46:30.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_dept] ([id], [name], [parent_id], [sort], [leader_user_id], [phone], [email], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'111', N'顶级部门', N'0', N'1', NULL, NULL, NULL, N'0', N'113', N'2022-03-07 21:44:50.0000000', N'113', N'2022-03-07 21:44:50.0000000', N'122', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_dept] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_dict_data +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_dict_data]') AND type IN ('U')) + DROP TABLE [dbo].[system_dict_data] +GO + +CREATE TABLE [dbo].[system_dict_data] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [sort] int NOT NULL, + [label] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [value] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [dict_type] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [color_type] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [css_class] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_dict_data] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典编码', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典排序', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'sort' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典标签', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'label' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典键值', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'value' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'dict_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'颜色类型', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'color_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'css 样式', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'css_class' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典数据表', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_data' +GO + + +-- ---------------------------- +-- Records of system_dict_data +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_dict_data] ON +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'1', N'男', N'1', N'system_user_sex', N'0', N'default', N'A', N'性别男', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-03-29 00:14:39.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'2', N'女', N'2', N'system_user_sex', N'1', N'success', N'', N'性别女', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 01:30:51.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'8', N'1', N'正常', N'1', N'infra_job_status', N'0', N'success', N'', N'正常状态', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 19:33:38.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'9', N'2', N'暂停', N'2', N'infra_job_status', N'0', N'danger', N'', N'停用状态', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 19:33:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'12', N'1', N'系统内置', N'1', N'infra_config_type', N'0', N'danger', N'', N'参数类型 - 系统内置', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 19:06:02.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'13', N'2', N'自定义', N'2', N'infra_config_type', N'0', N'primary', N'', N'参数类型 - 自定义', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 19:06:07.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'14', N'1', N'通知', N'1', N'system_notice_type', N'0', N'success', N'', N'通知', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 13:05:57.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'15', N'2', N'公告', N'2', N'system_notice_type', N'0', N'info', N'', N'公告', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 13:06:01.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'16', N'0', N'其它', N'0', N'system_operate_type', N'0', N'default', N'', N'其它操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:32:46.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'17', N'1', N'查询', N'1', N'system_operate_type', N'0', N'info', N'', N'查询操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:16.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'18', N'2', N'新增', N'2', N'system_operate_type', N'0', N'primary', N'', N'新增操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:13.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'19', N'3', N'修改', N'3', N'system_operate_type', N'0', N'warning', N'', N'修改操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:22.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'20', N'4', N'删除', N'4', N'system_operate_type', N'0', N'danger', N'', N'删除操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:27.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'22', N'5', N'导出', N'5', N'system_operate_type', N'0', N'default', N'', N'导出操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'23', N'6', N'导入', N'6', N'system_operate_type', N'0', N'default', N'', N'导入操作', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:33:35.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'27', N'1', N'开启', N'0', N'common_status', N'0', N'primary', N'', N'开启状态', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 08:00:39.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'28', N'2', N'关闭', N'1', N'common_status', N'0', N'info', N'', N'关闭状态', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 08:00:44.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'29', N'1', N'目录', N'1', N'system_menu_type', N'0', N'', N'', N'目录', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:43:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'30', N'2', N'菜单', N'2', N'system_menu_type', N'0', N'', N'', N'菜单', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:43:41.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'31', N'3', N'按钮', N'3', N'system_menu_type', N'0', N'', N'', N'按钮', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:43:39.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'32', N'1', N'内置', N'1', N'system_role_type', N'0', N'danger', N'', N'内置角色', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 13:02:08.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'33', N'2', N'自定义', N'2', N'system_role_type', N'0', N'primary', N'', N'自定义角色', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 13:02:12.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'34', N'1', N'全部数据权限', N'1', N'system_data_scope', N'0', N'', N'', N'全部数据权限', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:47:17.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'35', N'2', N'指定部门数据权限', N'2', N'system_data_scope', N'0', N'', N'', N'指定部门数据权限', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:47:18.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'36', N'3', N'本部门数据权限', N'3', N'system_data_scope', N'0', N'', N'', N'本部门数据权限', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:47:16.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'37', N'4', N'本部门及以下数据权限', N'4', N'system_data_scope', N'0', N'', N'', N'本部门及以下数据权限', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:47:21.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'38', N'5', N'仅本人数据权限', N'5', N'system_data_scope', N'0', N'', N'', N'仅本人数据权限', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:47:23.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'39', N'0', N'成功', N'0', N'system_login_result', N'0', N'success', N'', N'登陆结果 - 成功', N'', N'2021-01-18 06:17:36.0000000', N'1', N'2022-02-16 13:23:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'40', N'10', N'账号或密码不正确', N'10', N'system_login_result', N'0', N'primary', N'', N'登陆结果 - 账号或密码不正确', N'', N'2021-01-18 06:17:54.0000000', N'1', N'2022-02-16 13:24:27.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'41', N'20', N'用户被禁用', N'20', N'system_login_result', N'0', N'warning', N'', N'登陆结果 - 用户被禁用', N'', N'2021-01-18 06:17:54.0000000', N'1', N'2022-02-16 13:23:57.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'42', N'30', N'验证码不存在', N'30', N'system_login_result', N'0', N'info', N'', N'登陆结果 - 验证码不存在', N'', N'2021-01-18 06:17:54.0000000', N'1', N'2022-02-16 13:24:07.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'43', N'31', N'验证码不正确', N'31', N'system_login_result', N'0', N'info', N'', N'登陆结果 - 验证码不正确', N'', N'2021-01-18 06:17:54.0000000', N'1', N'2022-02-16 13:24:11.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'44', N'100', N'未知异常', N'100', N'system_login_result', N'0', N'danger', N'', N'登陆结果 - 未知异常', N'', N'2021-01-18 06:17:54.0000000', N'1', N'2022-02-16 13:24:23.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'45', N'1', N'是', N'true', N'infra_boolean_string', N'0', N'danger', N'', N'Boolean 是否类型 - 是', N'', N'2021-01-19 03:20:55.0000000', N'1', N'2022-03-15 23:01:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'46', N'1', N'否', N'false', N'infra_boolean_string', N'0', N'info', N'', N'Boolean 是否类型 - 否', N'', N'2021-01-19 03:20:55.0000000', N'1', N'2022-03-15 23:09:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'47', N'1', N'永不超时', N'1', N'infra_redis_timeout_type', N'0', N'primary', N'', N'Redis 未设置超时的情况', N'', N'2021-01-26 00:53:17.0000000', N'1', N'2022-02-16 19:03:35.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'48', N'1', N'动态超时', N'2', N'infra_redis_timeout_type', N'0', N'info', N'', N'程序里动态传入超时时间,无法固定', N'', N'2021-01-26 00:55:00.0000000', N'1', N'2022-02-16 19:03:41.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'49', N'3', N'固定超时', N'3', N'infra_redis_timeout_type', N'0', N'success', N'', N'Redis 设置了过期时间', N'', N'2021-01-26 00:55:26.0000000', N'1', N'2022-02-16 19:03:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'50', N'1', N'单表(增删改查)', N'1', N'infra_codegen_template_type', N'0', N'', N'', NULL, N'', N'2021-02-05 07:09:06.0000000', N'', N'2022-03-10 16:33:15.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'51', N'2', N'树表(增删改查)', N'2', N'infra_codegen_template_type', N'0', N'', N'', NULL, N'', N'2021-02-05 07:14:46.0000000', N'', N'2022-03-10 16:33:19.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'53', N'0', N'初始化中', N'0', N'infra_job_status', N'0', N'primary', N'', NULL, N'', N'2021-02-07 07:46:49.0000000', N'1', N'2022-02-16 19:33:29.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'57', N'0', N'运行中', N'0', N'infra_job_log_status', N'0', N'primary', N'', N'RUNNING', N'', N'2021-02-08 10:04:24.0000000', N'1', N'2022-02-16 19:07:48.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'58', N'1', N'成功', N'1', N'infra_job_log_status', N'0', N'success', N'', NULL, N'', N'2021-02-08 10:06:57.0000000', N'1', N'2022-02-16 19:07:52.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'59', N'2', N'失败', N'2', N'infra_job_log_status', N'0', N'warning', N'', N'失败', N'', N'2021-02-08 10:07:38.0000000', N'1', N'2022-02-16 19:07:56.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'60', N'1', N'会员', N'1', N'user_type', N'0', N'primary', N'', NULL, N'', N'2021-02-26 00:16:27.0000000', N'1', N'2022-02-16 10:22:19.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'61', N'2', N'管理员', N'2', N'user_type', N'0', N'success', N'', NULL, N'', N'2021-02-26 00:16:34.0000000', N'1', N'2022-02-16 10:22:22.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'62', N'0', N'未处理', N'0', N'infra_api_error_log_process_status', N'0', N'primary', N'', NULL, N'', N'2021-02-26 07:07:19.0000000', N'1', N'2022-02-16 20:14:17.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'63', N'1', N'已处理', N'1', N'infra_api_error_log_process_status', N'0', N'success', N'', NULL, N'', N'2021-02-26 07:07:26.0000000', N'1', N'2022-02-16 20:14:08.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'64', N'2', N'已忽略', N'2', N'infra_api_error_log_process_status', N'0', N'danger', N'', NULL, N'', N'2021-02-26 07:07:34.0000000', N'1', N'2022-02-16 20:14:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'65', N'1', N'云片', N'YUN_PIAN', N'system_sms_channel_code', N'0', N'success', N'', NULL, N'1', N'2021-04-05 01:05:14.0000000', N'1', N'2022-02-16 10:09:55.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'66', N'2', N'阿里云', N'ALIYUN', N'system_sms_channel_code', N'0', N'primary', N'', NULL, N'1', N'2021-04-05 01:05:26.0000000', N'1', N'2022-02-16 10:09:52.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'67', N'1', N'验证码', N'1', N'system_sms_template_type', N'0', N'warning', N'', NULL, N'1', N'2021-04-05 21:50:57.0000000', N'1', N'2022-02-16 12:48:30.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'68', N'2', N'通知', N'2', N'system_sms_template_type', N'0', N'primary', N'', NULL, N'1', N'2021-04-05 21:51:08.0000000', N'1', N'2022-02-16 12:48:27.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'69', N'0', N'营销', N'3', N'system_sms_template_type', N'0', N'danger', N'', NULL, N'1', N'2021-04-05 21:51:15.0000000', N'1', N'2022-02-16 12:48:22.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'70', N'0', N'初始化', N'0', N'system_sms_send_status', N'0', N'primary', N'', NULL, N'1', N'2021-04-11 20:18:33.0000000', N'1', N'2022-02-16 10:26:07.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'71', N'1', N'发送成功', N'10', N'system_sms_send_status', N'0', N'success', N'', NULL, N'1', N'2021-04-11 20:18:43.0000000', N'1', N'2022-02-16 10:25:56.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'72', N'2', N'发送失败', N'20', N'system_sms_send_status', N'0', N'danger', N'', NULL, N'1', N'2021-04-11 20:18:49.0000000', N'1', N'2022-02-16 10:26:03.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'73', N'3', N'不发送', N'30', N'system_sms_send_status', N'0', N'info', N'', NULL, N'1', N'2021-04-11 20:19:44.0000000', N'1', N'2022-02-16 10:26:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'74', N'0', N'等待结果', N'0', N'system_sms_receive_status', N'0', N'primary', N'', NULL, N'1', N'2021-04-11 20:27:43.0000000', N'1', N'2022-02-16 10:28:24.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'75', N'1', N'接收成功', N'10', N'system_sms_receive_status', N'0', N'success', N'', NULL, N'1', N'2021-04-11 20:29:25.0000000', N'1', N'2022-02-16 10:28:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'76', N'2', N'接收失败', N'20', N'system_sms_receive_status', N'0', N'danger', N'', NULL, N'1', N'2021-04-11 20:29:31.0000000', N'1', N'2022-02-16 10:28:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'77', N'0', N'调试(钉钉)', N'DEBUG_DING_TALK', N'system_sms_channel_code', N'0', N'info', N'', NULL, N'1', N'2021-04-13 00:20:37.0000000', N'1', N'2022-02-16 10:10:00.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'78', N'1', N'自动生成', N'1', N'system_error_code_type', N'0', N'warning', N'', NULL, N'1', N'2021-04-21 00:06:48.0000000', N'1', N'2022-02-16 13:57:20.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'79', N'2', N'手动编辑', N'2', N'system_error_code_type', N'0', N'primary', N'', NULL, N'1', N'2021-04-21 00:07:14.0000000', N'1', N'2022-02-16 13:57:24.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'80', N'100', N'账号登录', N'100', N'system_login_type', N'0', N'primary', N'', N'账号登录', N'1', N'2021-10-06 00:52:02.0000000', N'1', N'2022-02-16 13:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'81', N'101', N'社交登录', N'101', N'system_login_type', N'0', N'info', N'', N'社交登录', N'1', N'2021-10-06 00:52:17.0000000', N'1', N'2022-02-16 13:11:40.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'83', N'200', N'主动登出', N'200', N'system_login_type', N'0', N'primary', N'', N'主动登出', N'1', N'2021-10-06 00:52:58.0000000', N'1', N'2022-02-16 13:11:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'85', N'202', N'强制登出', N'202', N'system_login_type', N'0', N'danger', N'', N'强制退出', N'1', N'2021-10-06 00:53:41.0000000', N'1', N'2022-02-16 13:11:57.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'86', N'0', N'病假', N'1', N'bpm_oa_leave_type', N'0', N'primary', N'', NULL, N'1', N'2021-09-21 22:35:28.0000000', N'1', N'2022-02-16 10:00:41.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'87', N'1', N'事假', N'2', N'bpm_oa_leave_type', N'0', N'info', N'', NULL, N'1', N'2021-09-21 22:36:11.0000000', N'1', N'2022-02-16 10:00:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'88', N'2', N'婚假', N'3', N'bpm_oa_leave_type', N'0', N'warning', N'', NULL, N'1', N'2021-09-21 22:36:38.0000000', N'1', N'2022-02-16 10:00:53.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'98', N'1', N'v2', N'v2', N'pay_channel_wechat_version', N'0', N'', N'', N'v2版本', N'1', N'2021-11-08 17:00:58.0000000', N'1', N'2021-11-08 17:00:58.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'99', N'2', N'v3', N'v3', N'pay_channel_wechat_version', N'0', N'', N'', N'v3版本', N'1', N'2021-11-08 17:01:07.0000000', N'1', N'2021-11-08 17:01:07.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'108', N'1', N'RSA2', N'RSA2', N'pay_channel_alipay_sign_type', N'0', N'', N'', N'RSA2', N'1', N'2021-11-18 15:39:29.0000000', N'1', N'2021-11-18 15:39:29.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'109', N'1', N'公钥模式', N'1', N'pay_channel_alipay_mode', N'0', N'', N'', N'公钥模式:privateKey + alipayPublicKey', N'1', N'2021-11-18 15:45:23.0000000', N'1', N'2021-11-18 15:45:23.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'110', N'2', N'证书模式', N'2', N'pay_channel_alipay_mode', N'0', N'', N'', N'证书模式:appCertContent + alipayPublicCertContent + rootCertContent', N'1', N'2021-11-18 15:45:40.0000000', N'1', N'2021-11-18 15:45:40.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'111', N'1', N'线上', N'https://openapi.alipay.com/gateway.do', N'pay_channel_alipay_server_type', N'0', N'', N'', N'网关地址 - 线上', N'1', N'2021-11-18 16:59:32.0000000', N'1', N'2021-11-21 17:37:29.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'112', N'2', N'沙箱', N'https://openapi.alipaydev.com/gateway.do', N'pay_channel_alipay_server_type', N'0', N'', N'', N'网关地址 - 沙箱', N'1', N'2021-11-18 16:59:48.0000000', N'1', N'2021-11-21 17:37:39.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'113', N'1', N'微信 JSAPI 支付', N'wx_pub', N'pay_channel_code_type', N'0', N'', N'', N'微信 JSAPI(公众号) 支付', N'1', N'2021-12-03 10:40:24.0000000', N'1', N'2021-12-04 16:41:00.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'114', N'2', N'微信小程序支付', N'wx_lite', N'pay_channel_code_type', N'0', N'', N'', N'微信小程序支付', N'1', N'2021-12-03 10:41:06.0000000', N'1', N'2021-12-03 10:41:06.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'115', N'3', N'微信 App 支付', N'wx_app', N'pay_channel_code_type', N'0', N'', N'', N'微信 App 支付', N'1', N'2021-12-03 10:41:20.0000000', N'1', N'2021-12-03 10:41:20.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'116', N'4', N'支付宝 PC 网站支付', N'alipay_pc', N'pay_channel_code_type', N'0', N'', N'', N'支付宝 PC 网站支付', N'1', N'2021-12-03 10:42:09.0000000', N'1', N'2021-12-03 10:42:09.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'117', N'5', N'支付宝 Wap 网站支付', N'alipay_wap', N'pay_channel_code_type', N'0', N'', N'', N'支付宝 Wap 网站支付', N'1', N'2021-12-03 10:42:26.0000000', N'1', N'2021-12-03 10:42:26.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'118', N'6', N'支付宝App 支付', N'alipay_app', N'pay_channel_code_type', N'0', N'', N'', N'支付宝App 支付', N'1', N'2021-12-03 10:42:55.0000000', N'1', N'2021-12-03 10:42:55.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'119', N'7', N'支付宝扫码支付', N'alipay_qr', N'pay_channel_code_type', N'0', N'', N'', N'支付宝扫码支付', N'1', N'2021-12-03 10:43:10.0000000', N'1', N'2021-12-03 10:43:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'120', N'1', N'通知成功', N'10', N'pay_order_notify_status', N'0', N'success', N'', N'通知成功', N'1', N'2021-12-03 11:02:41.0000000', N'1', N'2022-02-16 13:59:13.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'121', N'2', N'通知失败', N'20', N'pay_order_notify_status', N'0', N'danger', N'', N'通知失败', N'1', N'2021-12-03 11:02:59.0000000', N'1', N'2022-02-16 13:59:17.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'122', N'3', N'未通知', N'0', N'pay_order_notify_status', N'0', N'info', N'', N'未通知', N'1', N'2021-12-03 11:03:10.0000000', N'1', N'2022-02-16 13:59:23.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'123', N'1', N'支付成功', N'10', N'pay_order_status', N'0', N'success', N'', N'支付成功', N'1', N'2021-12-03 11:18:29.0000000', N'1', N'2022-02-16 15:24:25.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'124', N'2', N'支付关闭', N'20', N'pay_order_status', N'0', N'danger', N'', N'支付关闭', N'1', N'2021-12-03 11:18:42.0000000', N'1', N'2022-02-16 15:24:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'125', N'3', N'未支付', N'0', N'pay_order_status', N'0', N'info', N'', N'未支付', N'1', N'2021-12-03 11:18:18.0000000', N'1', N'2022-02-16 15:24:35.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'126', N'1', N'未退款', N'0', N'pay_order_refund_status', N'0', N'', N'', N'未退款', N'1', N'2021-12-03 11:30:35.0000000', N'1', N'2021-12-03 11:34:05.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'127', N'2', N'部分退款', N'10', N'pay_order_refund_status', N'0', N'', N'', N'部分退款', N'1', N'2021-12-03 11:30:44.0000000', N'1', N'2021-12-03 11:34:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'128', N'3', N'全部退款', N'20', N'pay_order_refund_status', N'0', N'', N'', N'全部退款', N'1', N'2021-12-03 11:30:52.0000000', N'1', N'2021-12-03 11:34:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1117', N'1', N'退款订单生成', N'0', N'pay_refund_order_status', N'0', N'primary', N'', N'退款订单生成', N'1', N'2021-12-10 16:44:44.0000000', N'1', N'2022-02-16 14:05:24.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1118', N'2', N'退款成功', N'1', N'pay_refund_order_status', N'0', N'success', N'', N'退款成功', N'1', N'2021-12-10 16:44:59.0000000', N'1', N'2022-02-16 14:05:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1119', N'3', N'退款失败', N'2', N'pay_refund_order_status', N'0', N'danger', N'', N'退款失败', N'1', N'2021-12-10 16:45:10.0000000', N'1', N'2022-02-16 14:05:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1124', N'8', N'退款关闭', N'99', N'pay_refund_order_status', N'0', N'info', N'', N'退款关闭', N'1', N'2021-12-10 16:46:26.0000000', N'1', N'2022-02-16 14:05:40.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1125', N'0', N'默认', N'1', N'bpm_model_category', N'0', N'primary', N'', N'流程分类 - 默认', N'1', N'2022-01-02 08:41:11.0000000', N'1', N'2022-02-16 20:01:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1126', N'0', N'OA', N'2', N'bpm_model_category', N'0', N'success', N'', N'流程分类 - OA', N'1', N'2022-01-02 08:41:22.0000000', N'1', N'2022-02-16 20:01:50.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1127', N'0', N'进行中', N'1', N'bpm_process_instance_status', N'0', N'primary', N'', N'流程实例的状态 - 进行中', N'1', N'2022-01-07 23:47:22.0000000', N'1', N'2022-02-16 20:07:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1128', N'2', N'已完成', N'2', N'bpm_process_instance_status', N'0', N'success', N'', N'流程实例的状态 - 已完成', N'1', N'2022-01-07 23:47:49.0000000', N'1', N'2022-02-16 20:07:54.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1129', N'1', N'处理中', N'1', N'bpm_process_instance_result', N'0', N'primary', N'', N'流程实例的结果 - 处理中', N'1', N'2022-01-07 23:48:32.0000000', N'1', N'2022-02-16 09:53:26.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1130', N'2', N'通过', N'2', N'bpm_process_instance_result', N'0', N'success', N'', N'流程实例的结果 - 通过', N'1', N'2022-01-07 23:48:45.0000000', N'1', N'2022-02-16 09:53:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1131', N'3', N'不通过', N'3', N'bpm_process_instance_result', N'0', N'danger', N'', N'流程实例的结果 - 不通过', N'1', N'2022-01-07 23:48:55.0000000', N'1', N'2022-02-16 09:53:38.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1132', N'4', N'已取消', N'4', N'bpm_process_instance_result', N'0', N'info', N'', N'流程实例的结果 - 撤销', N'1', N'2022-01-07 23:49:06.0000000', N'1', N'2022-02-16 09:53:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1133', N'10', N'流程表单', N'10', N'bpm_model_form_type', N'0', N'', N'', N'流程的表单类型 - 流程表单', N'103', N'2022-01-11 23:51:30.0000000', N'103', N'2022-01-11 23:51:30.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1134', N'20', N'业务表单', N'20', N'bpm_model_form_type', N'0', N'', N'', N'流程的表单类型 - 业务表单', N'103', N'2022-01-11 23:51:47.0000000', N'103', N'2022-01-11 23:51:47.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1135', N'10', N'角色', N'10', N'bpm_task_assign_rule_type', N'0', N'info', N'', N'任务分配规则的类型 - 角色', N'103', N'2022-01-12 23:21:22.0000000', N'1', N'2022-02-16 20:06:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1136', N'20', N'部门的成员', N'20', N'bpm_task_assign_rule_type', N'0', N'primary', N'', N'任务分配规则的类型 - 部门的成员', N'103', N'2022-01-12 23:21:47.0000000', N'1', N'2022-02-16 20:05:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1137', N'21', N'部门的负责人', N'21', N'bpm_task_assign_rule_type', N'0', N'primary', N'', N'任务分配规则的类型 - 部门的负责人', N'103', N'2022-01-12 23:33:36.0000000', N'1', N'2022-02-16 20:05:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1138', N'30', N'用户', N'30', N'bpm_task_assign_rule_type', N'0', N'info', N'', N'任务分配规则的类型 - 用户', N'103', N'2022-01-12 23:34:02.0000000', N'1', N'2022-02-16 20:05:50.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1139', N'40', N'用户组', N'40', N'bpm_task_assign_rule_type', N'0', N'warning', N'', N'任务分配规则的类型 - 用户组', N'103', N'2022-01-12 23:34:21.0000000', N'1', N'2022-02-16 20:05:57.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1140', N'50', N'自定义脚本', N'50', N'bpm_task_assign_rule_type', N'0', N'danger', N'', N'任务分配规则的类型 - 自定义脚本', N'103', N'2022-01-12 23:34:43.0000000', N'1', N'2022-02-16 20:06:01.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1141', N'22', N'岗位', N'22', N'bpm_task_assign_rule_type', N'0', N'success', N'', N'任务分配规则的类型 - 岗位', N'103', N'2022-01-14 18:41:55.0000000', N'1', N'2022-02-16 20:05:39.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1142', N'10', N'流程发起人', N'10', N'bpm_task_assign_script', N'0', N'', N'', N'任务分配自定义脚本 - 流程发起人', N'103', N'2022-01-15 00:10:57.0000000', N'103', N'2022-01-15 21:24:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1143', N'20', N'流程发起人的一级领导', N'20', N'bpm_task_assign_script', N'0', N'', N'', N'任务分配自定义脚本 - 流程发起人的一级领导', N'103', N'2022-01-15 21:24:31.0000000', N'103', N'2022-01-15 21:24:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1144', N'21', N'流程发起人的二级领导', N'21', N'bpm_task_assign_script', N'0', N'', N'', N'任务分配自定义脚本 - 流程发起人的二级领导', N'103', N'2022-01-15 21:24:46.0000000', N'103', N'2022-01-15 21:24:57.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1145', N'1', N'管理后台', N'1', N'infra_codegen_scene', N'0', N'', N'', N'代码生成的场景枚举 - 管理后台', N'1', N'2022-02-02 13:15:06.0000000', N'1', N'2022-03-10 16:32:59.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1146', N'2', N'用户 APP', N'2', N'infra_codegen_scene', N'0', N'', N'', N'代码生成的场景枚举 - 用户 APP', N'1', N'2022-02-02 13:15:19.0000000', N'1', N'2022-03-10 16:33:03.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1147', N'0', N'未退款', N'0', N'pay_refund_order_type', N'0', N'info', N'', N'退款类型 - 未退款', N'1', N'2022-02-16 14:09:01.0000000', N'1', N'2022-02-16 14:09:01.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1148', N'10', N'部分退款', N'10', N'pay_refund_order_type', N'0', N'success', N'', N'退款类型 - 部分退款', N'1', N'2022-02-16 14:09:25.0000000', N'1', N'2022-02-16 14:11:38.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1149', N'20', N'全部退款', N'20', N'pay_refund_order_type', N'0', N'warning', N'', N'退款类型 - 全部退款', N'1', N'2022-02-16 14:11:33.0000000', N'1', N'2022-02-16 14:11:33.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1150', N'1', N'数据库', N'1', N'infra_file_storage', N'0', N'default', N'', NULL, N'1', N'2022-03-15 00:25:28.0000000', N'1', N'2022-03-15 00:25:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1151', N'10', N'本地磁盘', N'10', N'infra_file_storage', N'0', N'default', N'', NULL, N'1', N'2022-03-15 00:25:41.0000000', N'1', N'2022-03-15 00:25:56.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1152', N'11', N'FTP 服务器', N'11', N'infra_file_storage', N'0', N'default', N'', NULL, N'1', N'2022-03-15 00:26:06.0000000', N'1', N'2022-03-15 00:26:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1153', N'12', N'SFTP 服务器', N'12', N'infra_file_storage', N'0', N'default', N'', NULL, N'1', N'2022-03-15 00:26:22.0000000', N'1', N'2022-03-15 00:26:22.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1154', N'20', N'S3 对象存储', N'20', N'infra_file_storage', N'0', N'default', N'', NULL, N'1', N'2022-03-15 00:26:31.0000000', N'1', N'2022-03-15 00:26:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1155', N'103', N'短信登录', N'103', N'system_login_type', N'0', N'default', N'', NULL, N'1', N'2022-05-09 23:57:58.0000000', N'1', N'2022-05-09 23:58:09.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1156', N'1', N'password', N'password', N'system_oauth2_grant_type', N'0', N'default', N'', N'密码模式', N'1', N'2022-05-12 00:22:05.0000000', N'1', N'2022-05-11 16:26:01.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1157', N'2', N'authorization_code', N'authorization_code', N'system_oauth2_grant_type', N'0', N'primary', N'', N'授权码模式', N'1', N'2022-05-12 00:22:59.0000000', N'1', N'2022-05-11 16:26:02.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1158', N'3', N'implicit', N'implicit', N'system_oauth2_grant_type', N'0', N'success', N'', N'简化模式', N'1', N'2022-05-12 00:23:40.0000000', N'1', N'2022-05-11 16:26:05.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1159', N'4', N'client_credentials', N'client_credentials', N'system_oauth2_grant_type', N'0', N'default', N'', N'客户端模式', N'1', N'2022-05-12 00:23:51.0000000', N'1', N'2022-05-11 16:26:08.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1160', N'5', N'refresh_token', N'refresh_token', N'system_oauth2_grant_type', N'0', N'info', N'', N'刷新模式', N'1', N'2022-05-12 00:24:02.0000000', N'1', N'2022-05-11 16:26:11.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_dict_data] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_dict_type +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_dict_type]') AND type IN ('U')) + DROP TABLE [dbo].[system_dict_type] +GO + +CREATE TABLE [dbo].[system_dict_type] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_dict_type] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典主键', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典名称', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型表', +'SCHEMA', N'dbo', +'TABLE', N'system_dict_type' +GO + + +-- ---------------------------- +-- Records of system_dict_type +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_dict_type] ON +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'用户性别', N'system_user_sex', N'0', NULL, N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:30:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'6', N'参数类型', N'infra_config_type', N'0', NULL, N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:36:54.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'7', N'通知类型', N'system_notice_type', N'0', NULL, N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:35:26.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'9', N'操作类型', N'system_operate_type', N'0', NULL, N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-16 09:32:21.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'10', N'系统状态', N'common_status', N'0', NULL, N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-01 16:21:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'11', N'Boolean 是否类型', N'infra_boolean_string', N'0', N'boolean 转是否', N'', N'2021-01-19 03:20:08.0000000', N'', N'2022-02-01 16:37:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'104', N'登陆结果', N'system_login_result', N'0', N'登陆结果', N'', N'2021-01-18 06:17:11.0000000', N'', N'2022-02-01 16:36:00.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'105', N'Redis 超时类型', N'infra_redis_timeout_type', N'0', N'RedisKeyDefine.TimeoutTypeEnum', N'', N'2021-01-26 00:52:50.0000000', N'', N'2022-02-01 16:50:29.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'106', N'代码生成模板类型', N'infra_codegen_template_type', N'0', NULL, N'', N'2021-02-05 07:08:06.0000000', N'', N'2022-03-10 16:33:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'107', N'定时任务状态', N'infra_job_status', N'0', NULL, N'', N'2021-02-07 07:44:16.0000000', N'', N'2022-02-01 16:51:11.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'108', N'定时任务日志状态', N'infra_job_log_status', N'0', NULL, N'', N'2021-02-08 10:03:51.0000000', N'', N'2022-02-01 16:50:43.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'109', N'用户类型', N'user_type', N'0', NULL, N'', N'2021-02-26 00:15:51.0000000', N'', N'2021-02-26 00:15:51.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'110', N'API 异常数据的处理状态', N'infra_api_error_log_process_status', N'0', NULL, N'', N'2021-02-26 07:07:01.0000000', N'', N'2022-02-01 16:50:53.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'111', N'短信渠道编码', N'system_sms_channel_code', N'0', NULL, N'1', N'2021-04-05 01:04:50.0000000', N'1', N'2022-02-16 02:09:08.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'112', N'短信模板的类型', N'system_sms_template_type', N'0', NULL, N'1', N'2021-04-05 21:50:43.0000000', N'1', N'2022-02-01 16:35:06.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'113', N'短信发送状态', N'system_sms_send_status', N'0', NULL, N'1', N'2021-04-11 20:18:03.0000000', N'1', N'2022-02-01 16:35:09.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'114', N'短信接收状态', N'system_sms_receive_status', N'0', NULL, N'1', N'2021-04-11 20:27:14.0000000', N'1', N'2022-02-01 16:35:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'115', N'错误码的类型', N'system_error_code_type', N'0', NULL, N'1', N'2021-04-21 00:06:30.0000000', N'1', N'2022-02-01 16:36:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'116', N'登陆日志的类型', N'system_login_type', N'0', N'登陆日志的类型', N'1', N'2021-10-06 00:50:46.0000000', N'1', N'2022-02-01 16:35:56.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'117', N'OA 请假类型', N'bpm_oa_leave_type', N'0', NULL, N'1', N'2021-09-21 22:34:33.0000000', N'1', N'2022-01-22 10:41:37.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'122', N'支付渠道微信版本', N'pay_channel_wechat_version', N'0', N'支付渠道微信版本', N'1', N'2021-11-08 17:00:26.0000000', N'1', N'2021-11-08 17:00:26.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'127', N'支付渠道支付宝算法类型', N'pay_channel_alipay_sign_type', N'0', N'支付渠道支付宝算法类型', N'1', N'2021-11-18 15:39:09.0000000', N'1', N'2021-11-18 15:39:09.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'128', N'支付渠道支付宝公钥类型', N'pay_channel_alipay_mode', N'0', N'支付渠道支付宝公钥类型', N'1', N'2021-11-18 15:44:28.0000000', N'1', N'2021-11-18 15:44:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'129', N'支付宝网关地址', N'pay_channel_alipay_server_type', N'0', N'支付宝网关地址', N'1', N'2021-11-18 16:58:55.0000000', N'1', N'2021-11-18 17:01:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'130', N'支付渠道编码类型', N'pay_channel_code_type', N'0', N'支付渠道的编码', N'1', N'2021-12-03 10:35:08.0000000', N'1', N'2021-12-03 10:35:08.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'131', N'支付订单回调状态', N'pay_order_notify_status', N'0', N'支付订单回调状态', N'1', N'2021-12-03 10:53:29.0000000', N'1', N'2021-12-03 10:53:29.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'132', N'支付订单状态', N'pay_order_status', N'0', N'支付订单状态', N'1', N'2021-12-03 11:17:50.0000000', N'1', N'2021-12-03 11:17:50.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'133', N'支付订单退款状态', N'pay_order_refund_status', N'0', N'支付订单退款状态', N'1', N'2021-12-03 11:27:31.0000000', N'1', N'2021-12-03 11:27:31.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'134', N'退款订单状态', N'pay_refund_order_status', N'0', N'退款订单状态', N'1', N'2021-12-10 16:42:50.0000000', N'1', N'2021-12-10 16:42:50.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'135', N'退款订单类别', N'pay_refund_order_type', N'0', N'退款订单类别', N'1', N'2021-12-10 17:14:53.0000000', N'1', N'2021-12-10 17:14:53.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'138', N'流程分类', N'bpm_model_category', N'0', N'流程分类', N'1', N'2022-01-02 08:40:45.0000000', N'1', N'2022-01-02 08:40:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'139', N'流程实例的状态', N'bpm_process_instance_status', N'0', N'流程实例的状态', N'1', N'2022-01-07 23:46:42.0000000', N'1', N'2022-01-07 23:46:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'140', N'流程实例的结果', N'bpm_process_instance_result', N'0', N'流程实例的结果', N'1', N'2022-01-07 23:48:10.0000000', N'1', N'2022-01-07 23:48:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'141', N'流程的表单类型', N'bpm_model_form_type', N'0', N'流程的表单类型', N'103', N'2022-01-11 23:50:45.0000000', N'103', N'2022-01-11 23:50:45.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'142', N'任务分配规则的类型', N'bpm_task_assign_rule_type', N'0', N'任务分配规则的类型', N'103', N'2022-01-12 23:21:04.0000000', N'103', N'2022-01-12 15:46:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'143', N'任务分配自定义脚本', N'bpm_task_assign_script', N'0', N'任务分配自定义脚本', N'103', N'2022-01-15 00:10:35.0000000', N'103', N'2022-01-15 00:10:35.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'144', N'代码生成的场景枚举', N'infra_codegen_scene', N'0', N'代码生成的场景枚举', N'1', N'2022-02-02 13:14:45.0000000', N'1', N'2022-03-10 16:33:46.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'145', N'角色类型', N'system_role_type', N'0', N'角色类型', N'1', N'2022-02-16 13:01:46.0000000', N'1', N'2022-02-16 13:01:46.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'146', N'文件存储器', N'infra_file_storage', N'0', N'文件存储器', N'1', N'2022-03-15 00:24:38.0000000', N'1', N'2022-03-15 00:24:38.0000000', N'0') +GO + +INSERT INTO [dbo].[system_dict_type] ([id], [name], [type], [status], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'147', N'OAuth 2.0 授权类型', N'system_oauth2_grant_type', N'0', N'OAuth 2.0 授权类型(模式)', N'1', N'2022-05-12 00:20:52.0000000', N'1', N'2022-05-11 16:25:49.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_dict_type] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_error_code +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_error_code]') AND type IN ('U')) + DROP TABLE [dbo].[system_error_code] +GO + +CREATE TABLE [dbo].[system_error_code] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [type] tinyint NOT NULL, + [application_name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [code] int NOT NULL, + [message] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [memo] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_error_code] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'错误码编号', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'错误码类型', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用名', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'application_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'错误码编码', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'错误码错误提示', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'message' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'memo' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'错误码表', +'SCHEMA', N'dbo', +'TABLE', N'system_error_code' +GO + + +-- ---------------------------- +-- Records of system_error_code +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_error_code] ON +GO + +SET IDENTITY_INSERT [dbo].[system_error_code] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_login_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_login_log]') AND type IN ('U')) + DROP TABLE [dbo].[system_login_log] +GO + +CREATE TABLE [dbo].[system_login_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [log_type] bigint NOT NULL, + [trace_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_id] bigint NOT NULL, + [user_type] tinyint NOT NULL, + [username] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [result] tinyint NOT NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_agent] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_login_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'访问ID', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'日志类型', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'log_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'链路追踪编号', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'trace_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户账号', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'username' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'登陆结果', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'result' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'浏览器 UA', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'user_agent' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'系统访问记录', +'SCHEMA', N'dbo', +'TABLE', N'system_login_log' +GO + + +-- ---------------------------- +-- Records of system_login_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_login_log] ON +GO + +SET IDENTITY_INSERT [dbo].[system_login_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_menu +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_menu]') AND type IN ('U')) + DROP TABLE [dbo].[system_menu] +GO + +CREATE TABLE [dbo].[system_menu] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [permission] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] tinyint NOT NULL, + [sort] int NOT NULL, + [parent_id] bigint NOT NULL, + [path] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [icon] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [component] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [visible] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [keep_alive] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_menu] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单名称', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'权限标识', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'permission' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单类型', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'显示顺序', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'sort' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'父菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'parent_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'路由地址', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'path' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单图标', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'icon' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'组件路径', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'component' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单状态', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否可见', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'visible' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否缓存', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'keep_alive' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_menu', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单权限表', +'SCHEMA', N'dbo', +'TABLE', N'system_menu' +GO + + +-- ---------------------------- +-- Records of system_menu +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_menu] ON +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'系统管理', N'', N'1', N'10', N'0', N'/system', N'system', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'基础设施', N'', N'1', N'20', N'0', N'/infra', N'monitor', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'5', N'OA 示例', N'', N'1', N'40', N'1185', N'oa', N'people', N'', N'0', N'1', N'1', N'admin', N'2021-09-20 16:26:19.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'100', N'用户管理', N'system:user:list', N'2', N'1', N'1', N'user', N'user', N'system/user/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'101', N'角色管理', N'', N'2', N'2', N'1', N'role', N'peoples', N'system/role/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'102', N'菜单管理', N'', N'2', N'3', N'1', N'menu', N'tree-table', N'system/menu/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'103', N'部门管理', N'', N'2', N'4', N'1', N'dept', N'tree', N'system/dept/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'104', N'岗位管理', N'', N'2', N'5', N'1', N'post', N'post', N'system/post/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'105', N'字典管理', N'', N'2', N'6', N'1', N'dict', N'dict', N'system/dict/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'106', N'配置管理', N'', N'2', N'6', N'2', N'config', N'edit', N'infra/config/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'107', N'通知公告', N'', N'2', N'8', N'1', N'notice', N'message', N'system/notice/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'108', N'审计日志', N'', N'1', N'9', N'1', N'log', N'log', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'109', N'令牌管理', N'', N'2', N'2', N'1261', N'token', N'online', N'system/oauth2/token/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-05-11 23:31:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'110', N'定时任务', N'', N'2', N'12', N'2', N'job', N'job', N'infra/job/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'111', N'MySQL 监控', N'', N'2', N'9', N'2', N'druid', N'druid', N'infra/druid/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'112', N'Java 监控', N'', N'2', N'11', N'2', N'admin-server', N'server', N'infra/server/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'113', N'Redis 监控', N'', N'2', N'10', N'2', N'redis', N'redis', N'infra/redis/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'114', N'表单构建', N'infra:build:list', N'2', N'2', N'2', N'build', N'build', N'infra/build/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'115', N'代码生成', N'infra:codegen:query', N'2', N'1', N'2', N'codegen', N'code', N'infra/codegen/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'116', N'系统接口', N'infra:swagger:list', N'2', N'3', N'2', N'swagger', N'swagger', N'infra/swagger/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'500', N'操作日志', N'', N'2', N'1', N'108', N'operate-log', N'form', N'system/operatelog/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'501', N'登录日志', N'', N'2', N'2', N'108', N'login-log', N'logininfor', N'system/loginlog/index', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1001', N'用户查询', N'system:user:query', N'3', N'1', N'100', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1002', N'用户新增', N'system:user:create', N'3', N'2', N'100', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1003', N'用户修改', N'system:user:update', N'3', N'3', N'100', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1004', N'用户删除', N'system:user:delete', N'3', N'4', N'100', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1005', N'用户导出', N'system:user:export', N'3', N'5', N'100', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1006', N'用户导入', N'system:user:import', N'3', N'6', N'100', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1007', N'重置密码', N'system:user:update-password', N'3', N'7', N'100', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1008', N'角色查询', N'system:role:query', N'3', N'1', N'101', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1009', N'角色新增', N'system:role:create', N'3', N'2', N'101', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1010', N'角色修改', N'system:role:update', N'3', N'3', N'101', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1011', N'角色删除', N'system:role:delete', N'3', N'4', N'101', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1012', N'角色导出', N'system:role:export', N'3', N'5', N'101', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1013', N'菜单查询', N'system:menu:query', N'3', N'1', N'102', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1014', N'菜单新增', N'system:menu:create', N'3', N'2', N'102', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1015', N'菜单修改', N'system:menu:update', N'3', N'3', N'102', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1016', N'菜单删除', N'system:menu:delete', N'3', N'4', N'102', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1017', N'部门查询', N'system:dept:query', N'3', N'1', N'103', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1018', N'部门新增', N'system:dept:create', N'3', N'2', N'103', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1019', N'部门修改', N'system:dept:update', N'3', N'3', N'103', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1020', N'部门删除', N'system:dept:delete', N'3', N'4', N'103', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1021', N'岗位查询', N'system:post:query', N'3', N'1', N'104', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1022', N'岗位新增', N'system:post:create', N'3', N'2', N'104', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1023', N'岗位修改', N'system:post:update', N'3', N'3', N'104', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1024', N'岗位删除', N'system:post:delete', N'3', N'4', N'104', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1025', N'岗位导出', N'system:post:export', N'3', N'5', N'104', N'', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1026', N'字典查询', N'system:dict:query', N'3', N'1', N'105', N'#', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1027', N'字典新增', N'system:dict:create', N'3', N'2', N'105', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1028', N'字典修改', N'system:dict:update', N'3', N'3', N'105', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1029', N'字典删除', N'system:dict:delete', N'3', N'4', N'105', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1030', N'字典导出', N'system:dict:export', N'3', N'5', N'105', N'#', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1031', N'配置查询', N'infra:config:query', N'3', N'1', N'106', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1032', N'配置新增', N'infra:config:create', N'3', N'2', N'106', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1033', N'配置修改', N'infra:config:update', N'3', N'3', N'106', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1034', N'配置删除', N'infra:config:delete', N'3', N'4', N'106', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1035', N'配置导出', N'infra:config:export', N'3', N'5', N'106', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1036', N'公告查询', N'system:notice:query', N'3', N'1', N'107', N'#', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1037', N'公告新增', N'system:notice:create', N'3', N'2', N'107', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1038', N'公告修改', N'system:notice:update', N'3', N'3', N'107', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1039', N'公告删除', N'system:notice:delete', N'3', N'4', N'107', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1040', N'操作查询', N'system:operate-log:query', N'3', N'1', N'500', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1042', N'日志导出', N'system:operate-log:export', N'3', N'2', N'500', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1043', N'登录查询', N'system:login-log:query', N'3', N'1', N'501', N'#', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1045', N'日志导出', N'system:login-log:export', N'3', N'3', N'501', N'#', N'#', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1046', N'令牌列表', N'system:oauth2-token:page', N'3', N'1', N'109', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-05-09 23:54:42.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1048', N'令牌删除', N'system:oauth2-token:delete', N'3', N'2', N'109', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-05-09 23:54:53.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1050', N'任务新增', N'infra:job:create', N'3', N'2', N'110', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1051', N'任务修改', N'infra:job:update', N'3', N'3', N'110', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1052', N'任务删除', N'infra:job:delete', N'3', N'4', N'110', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1053', N'状态修改', N'infra:job:update', N'3', N'5', N'110', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1054', N'任务导出', N'infra:job:export', N'3', N'7', N'110', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1056', N'生成修改', N'infra:codegen:update', N'3', N'2', N'115', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1057', N'生成删除', N'infra:codegen:delete', N'3', N'3', N'115', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1058', N'导入代码', N'infra:codegen:create', N'3', N'2', N'115', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1059', N'预览代码', N'infra:codegen:preview', N'3', N'4', N'115', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1060', N'生成代码', N'infra:codegen:download', N'3', N'5', N'115', N'', N'', N'', N'0', N'1', N'1', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1063', N'设置角色菜单权限', N'system:permission:assign-role-menu', N'3', N'6', N'101', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-01-06 17:53:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1064', N'设置角色数据权限', N'system:permission:assign-role-data-scope', N'3', N'7', N'101', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-01-06 17:56:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1065', N'设置用户角色', N'system:permission:assign-user-role', N'3', N'8', N'101', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-01-07 10:23:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1066', N'获得 Redis 监控信息', N'infra:redis:get-monitor-info', N'3', N'1', N'113', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-01-26 01:02:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1067', N'获得 Redis Key 列表', N'infra:redis:get-key-list', N'3', N'2', N'113', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-01-26 01:02:52.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1070', N'代码生成示例', N'infra:test-demo:query', N'2', N'1', N'2', N'test-demo', N'validCode', N'infra/testDemo/index', N'0', N'1', N'1', N'', N'2021-02-06 12:42:49.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1071', N'测试示例表创建', N'infra:test-demo:create', N'3', N'1', N'1070', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-06 12:42:49.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1072', N'测试示例表更新', N'infra:test-demo:update', N'3', N'2', N'1070', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-06 12:42:49.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1073', N'测试示例表删除', N'infra:test-demo:delete', N'3', N'3', N'1070', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-06 12:42:49.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1074', N'测试示例表导出', N'infra:test-demo:export', N'3', N'4', N'1070', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-06 12:42:49.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1075', N'任务触发', N'infra:job:trigger', N'3', N'8', N'110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-07 13:03:10.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1076', N'数据库文档', N'', N'2', N'4', N'2', N'db-doc', N'table', N'infra/dbDoc/index', N'0', N'1', N'1', N'', N'2021-02-08 01:41:47.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1077', N'监控平台', N'', N'2', N'13', N'2', N'skywalking', N'eye-open', N'infra/skywalking/index', N'0', N'1', N'1', N'', N'2021-02-08 20:41:31.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1078', N'访问日志', N'', N'2', N'1', N'1083', N'api-access-log', N'log', N'infra/apiAccessLog/index', N'0', N'1', N'1', N'', N'2021-02-26 01:32:59.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1082', N'日志导出', N'infra:api-access-log:export', N'3', N'2', N'1078', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-26 01:32:59.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1083', N'API 日志', N'', N'2', N'8', N'2', N'log', N'log', N'', N'0', N'1', N'1', N'', N'2021-02-26 02:18:24.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1084', N'错误日志', N'infra:api-error-log:query', N'2', N'2', N'1083', N'api-error-log', N'log', N'infra/apiErrorLog/index', N'0', N'1', N'1', N'', N'2021-02-26 07:53:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1085', N'日志处理', N'infra:api-error-log:update-status', N'3', N'2', N'1084', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-26 07:53:20.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1086', N'日志导出', N'infra:api-error-log:export', N'3', N'3', N'1084', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-02-26 07:53:20.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1087', N'任务查询', N'infra:job:query', N'3', N'1', N'110', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-03-10 01:26:19.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1088', N'日志查询', N'infra:api-access-log:query', N'3', N'1', N'1078', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-03-10 01:28:04.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1089', N'日志查询', N'infra:api-error-log:query', N'3', N'1', N'1084', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-03-10 01:29:09.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1090', N'文件列表', N'', N'2', N'5', N'1243', N'file', N'upload', N'infra/file/index', N'0', N'1', N'1', N'', N'2021-03-12 20:16:20.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1091', N'文件查询', N'infra:file:query', N'3', N'1', N'1090', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-03-12 20:16:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1092', N'文件删除', N'infra:file:delete', N'3', N'4', N'1090', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-03-12 20:16:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1093', N'短信管理', N'', N'1', N'11', N'1', N'sms', N'validCode', N'', N'0', N'1', N'1', N'1', N'2021-04-05 01:10:16.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1094', N'短信渠道', N'', N'2', N'0', N'1093', N'sms-channel', N'phone', N'system/sms/smsChannel', N'0', N'1', N'1', N'', N'2021-04-01 11:07:15.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1095', N'短信渠道查询', N'system:sms-channel:query', N'3', N'1', N'1094', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 11:07:15.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1096', N'短信渠道创建', N'system:sms-channel:create', N'3', N'2', N'1094', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 11:07:15.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1097', N'短信渠道更新', N'system:sms-channel:update', N'3', N'3', N'1094', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 11:07:15.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1098', N'短信渠道删除', N'system:sms-channel:delete', N'3', N'4', N'1094', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 11:07:15.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1100', N'短信模板', N'', N'2', N'1', N'1093', N'sms-template', N'phone', N'system/sms/smsTemplate', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1101', N'短信模板查询', N'system:sms-template:query', N'3', N'1', N'1100', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1102', N'短信模板创建', N'system:sms-template:create', N'3', N'2', N'1100', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1103', N'短信模板更新', N'system:sms-template:update', N'3', N'3', N'1100', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1104', N'短信模板删除', N'system:sms-template:delete', N'3', N'4', N'1100', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1105', N'短信模板导出', N'system:sms-template:export', N'3', N'5', N'1100', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-01 17:35:17.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1106', N'发送测试短信', N'system:sms-template:send-sms', N'3', N'6', N'1100', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-04-11 00:26:40.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1107', N'短信日志', N'', N'2', N'2', N'1093', N'sms-log', N'phone', N'system/sms/smsLog', N'0', N'1', N'1', N'', N'2021-04-11 08:37:05.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1108', N'短信日志查询', N'system:sms-log:query', N'3', N'1', N'1107', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-11 08:37:05.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1109', N'短信日志导出', N'system:sms-log:export', N'3', N'5', N'1107', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-11 08:37:05.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1110', N'错误码管理', N'', N'2', N'12', N'1', N'error-code', N'code', N'system/errorCode/index', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1111', N'错误码查询', N'system:error-code:query', N'3', N'1', N'1110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1112', N'错误码创建', N'system:error-code:create', N'3', N'2', N'1110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1113', N'错误码更新', N'system:error-code:update', N'3', N'3', N'1110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1114', N'错误码删除', N'system:error-code:delete', N'3', N'4', N'1110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1115', N'错误码导出', N'system:error-code:export', N'3', N'5', N'1110', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-04-13 21:46:42.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1117', N'支付管理', N'', N'1', N'11', N'0', N'/pay', N'money', N'', N'0', N'1', N'1', N'1', N'2021-12-25 16:43:41.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1118', N'请假查询', N'', N'2', N'0', N'5', N'leave', N'user', N'bpm/oa/leave/index', N'0', N'1', N'1', N'', N'2021-09-20 08:51:03.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1119', N'请假申请查询', N'bpm:oa-leave:query', N'3', N'1', N'1118', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-09-20 08:51:03.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1120', N'请假申请创建', N'bpm:oa-leave:create', N'3', N'2', N'1118', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-09-20 08:51:03.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1126', N'应用信息', N'', N'2', N'1', N'1117', N'app', N'table', N'pay/app/index', N'0', N'1', N'1', N'', N'2021-11-10 01:13:30.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1127', N'支付应用信息查询', N'pay:app:query', N'3', N'1', N'1126', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1128', N'支付应用信息创建', N'pay:app:create', N'3', N'2', N'1126', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1129', N'支付应用信息更新', N'pay:app:update', N'3', N'3', N'1126', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1130', N'支付应用信息删除', N'pay:app:delete', N'3', N'4', N'1126', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1131', N'支付应用信息导出', N'pay:app:export', N'3', N'5', N'1126', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:31.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1132', N'秘钥解析', N'pay:channel:parsing', N'3', N'6', N'1129', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-11-08 15:15:47.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1133', N'支付商户信息查询', N'pay:merchant:query', N'3', N'1', N'1132', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:41.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1134', N'支付商户信息创建', N'pay:merchant:create', N'3', N'2', N'1132', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:41.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1135', N'支付商户信息更新', N'pay:merchant:update', N'3', N'3', N'1132', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:41.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1136', N'支付商户信息删除', N'pay:merchant:delete', N'3', N'4', N'1132', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:41.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1137', N'支付商户信息导出', N'pay:merchant:export', N'3', N'5', N'1132', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-11-10 01:13:41.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1138', N'租户列表', N'', N'2', N'0', N'1224', N'list', N'peoples', N'system/tenant/index', N'0', N'1', N'1', N'', N'2021-12-14 12:31:43.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1139', N'租户查询', N'system:tenant:query', N'3', N'1', N'1138', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-14 12:31:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1140', N'租户创建', N'system:tenant:create', N'3', N'2', N'1138', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-14 12:31:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1141', N'租户更新', N'system:tenant:update', N'3', N'3', N'1138', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-14 12:31:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1142', N'租户删除', N'system:tenant:delete', N'3', N'4', N'1138', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-14 12:31:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1143', N'租户导出', N'system:tenant:export', N'3', N'5', N'1138', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-14 12:31:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1150', N'秘钥解析', N'', N'3', N'6', N'1129', N'', N'', N'', N'0', N'1', N'1', N'1', N'2021-11-08 15:15:47.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1161', N'退款订单', N'', N'2', N'3', N'1117', N'refund', N'order', N'pay/refund/index', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1162', N'退款订单查询', N'pay:refund:query', N'3', N'1', N'1161', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1163', N'退款订单创建', N'pay:refund:create', N'3', N'2', N'1161', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1164', N'退款订单更新', N'pay:refund:update', N'3', N'3', N'1161', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1165', N'退款订单删除', N'pay:refund:delete', N'3', N'4', N'1161', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1166', N'退款订单导出', N'pay:refund:export', N'3', N'5', N'1161', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:29:07.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1173', N'支付订单', N'', N'2', N'2', N'1117', N'order', N'pay', N'pay/order/index', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1174', N'支付订单查询', N'pay:order:query', N'3', N'1', N'1173', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1175', N'支付订单创建', N'pay:order:create', N'3', N'2', N'1173', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1176', N'支付订单更新', N'pay:order:update', N'3', N'3', N'1173', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1177', N'支付订单删除', N'pay:order:delete', N'3', N'4', N'1173', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1178', N'支付订单导出', N'pay:order:export', N'3', N'5', N'1173', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 08:49:43.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1179', N'商户信息', N'', N'2', N'0', N'1117', N'merchant', N'merchant', N'pay/merchant/index', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1180', N'支付商户信息查询', N'pay:merchant:query', N'3', N'1', N'1179', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1181', N'支付商户信息创建', N'pay:merchant:create', N'3', N'2', N'1179', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1182', N'支付商户信息更新', N'pay:merchant:update', N'3', N'3', N'1179', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1183', N'支付商户信息删除', N'', N'3', N'4', N'1179', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1184', N'支付商户信息导出', N'pay:merchant:export', N'3', N'5', N'1179', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-25 09:01:44.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1185', N'工作流程', N'', N'1', N'50', N'0', N'/bpm', N'tool', N'', N'0', N'1', N'1', N'1', N'2021-12-30 20:26:36.0000000', N'103', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1186', N'流程管理', N'', N'1', N'10', N'1185', N'manager', N'nested', N'', N'0', N'1', N'1', N'1', N'2021-12-30 20:28:30.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1187', N'流程表单', N'', N'2', N'0', N'1186', N'form', N'form', N'bpm/form/index', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1188', N'表单查询', N'bpm:form:query', N'3', N'1', N'1187', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1189', N'表单创建', N'bpm:form:create', N'3', N'2', N'1187', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1190', N'表单更新', N'bpm:form:update', N'3', N'3', N'1187', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1191', N'表单删除', N'bpm:form:delete', N'3', N'4', N'1187', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1192', N'表单导出', N'bpm:form:export', N'3', N'5', N'1187', N'', N'', N'', N'0', N'1', N'1', N'', N'2021-12-30 12:38:22.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1193', N'流程模型', N'', N'2', N'5', N'1186', N'model', N'guide', N'bpm/model/index', N'0', N'1', N'1', N'1', N'2021-12-31 23:24:58.0000000', N'103', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1194', N'模型查询', N'bpm:model:query', N'3', N'1', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:01:10.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1195', N'模型创建', N'bpm:model:create', N'3', N'2', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:01:24.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1196', N'模型导入', N'bpm:model:import', N'3', N'3', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:01:35.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1197', N'模型更新', N'bpm:model:update', N'3', N'4', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:02:28.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1198', N'模型删除', N'bpm:model:delete', N'3', N'5', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:02:43.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1199', N'模型发布', N'bpm:model:deploy', N'3', N'6', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-03 19:03:24.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1200', N'任务管理', N'', N'1', N'20', N'1185', N'task', N'cascader', N'', N'0', N'1', N'1', N'1', N'2022-01-07 23:51:48.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1201', N'我的流程', N'', N'2', N'0', N'1200', N'my', N'people', N'bpm/processInstance/index', N'0', N'1', N'1', N'', N'2022-01-07 15:53:44.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1202', N'流程实例的查询', N'bpm:process-instance:query', N'3', N'1', N'1201', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-01-07 15:53:44.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1207', N'待办任务', N'', N'2', N'10', N'1200', N'todo', N'eye-open', N'bpm/task/todo', N'0', N'1', N'1', N'1', N'2022-01-08 10:33:37.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1208', N'已办任务', N'', N'2', N'20', N'1200', N'done', N'eye', N'bpm/task/done', N'0', N'1', N'1', N'1', N'2022-01-08 10:34:13.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1209', N'用户分组', N'', N'2', N'2', N'1186', N'user-group', N'people', N'bpm/group/index', N'0', N'1', N'1', N'', N'2022-01-14 02:14:20.0000000', N'103', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1210', N'用户组查询', N'bpm:user-group:query', N'3', N'1', N'1209', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-01-14 02:14:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1211', N'用户组创建', N'bpm:user-group:create', N'3', N'2', N'1209', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-01-14 02:14:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1212', N'用户组更新', N'bpm:user-group:update', N'3', N'3', N'1209', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-01-14 02:14:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1213', N'用户组删除', N'bpm:user-group:delete', N'3', N'4', N'1209', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-01-14 02:14:20.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1215', N'流程定义查询', N'bpm:process-definition:query', N'3', N'10', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:21:43.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1216', N'流程任务分配规则查询', N'bpm:task-assign-rule:query', N'3', N'20', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:26:53.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1217', N'流程任务分配规则创建', N'bpm:task-assign-rule:create', N'3', N'21', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:28:15.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1218', N'流程任务分配规则更新', N'bpm:task-assign-rule:update', N'3', N'22', N'1193', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:28:41.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1219', N'流程实例的创建', N'bpm:process-instance:create', N'3', N'2', N'1201', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:36:15.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1220', N'流程实例的取消', N'bpm:process-instance:cancel', N'3', N'3', N'1201', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:36:33.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1221', N'流程任务的查询', N'bpm:task:query', N'3', N'1', N'1207', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:38:52.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1222', N'流程任务的更新', N'bpm:task:update', N'3', N'2', N'1207', N'', N'', N'', N'0', N'1', N'1', N'1', N'2022-01-23 00:39:24.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1224', N'租户管理', N'', N'2', N'0', N'1', N'tenant', N'peoples', N'', N'0', N'1', N'1', N'1', N'2022-02-20 01:41:13.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1225', N'租户套餐', N'', N'2', N'0', N'1224', N'package', N'eye', N'system/tenantPackage/index', N'0', N'1', N'1', N'', N'2022-02-19 17:44:06.0000000', N'1', N'2022-04-21 01:21:25.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1226', N'租户套餐查询', N'system:tenant-package:query', N'3', N'1', N'1225', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-02-19 17:44:06.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1227', N'租户套餐创建', N'system:tenant-package:create', N'3', N'2', N'1225', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-02-19 17:44:06.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1228', N'租户套餐更新', N'system:tenant-package:update', N'3', N'3', N'1225', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-02-19 17:44:06.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1229', N'租户套餐删除', N'system:tenant-package:delete', N'3', N'4', N'1225', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-02-19 17:44:06.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1237', N'文件配置', N'', N'2', N'0', N'1243', N'file-config', N'config', N'infra/fileConfig/index', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1238', N'文件配置查询', N'infra:file-config:query', N'3', N'1', N'1237', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1239', N'文件配置创建', N'infra:file-config:create', N'3', N'2', N'1237', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1240', N'文件配置更新', N'infra:file-config:update', N'3', N'3', N'1237', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1241', N'文件配置删除', N'infra:file-config:delete', N'3', N'4', N'1237', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1242', N'文件配置导出', N'infra:file-config:export', N'3', N'5', N'1237', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-03-15 14:35:28.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1243', N'文件管理', N'', N'2', N'5', N'2', N'file', N'download', N'', N'0', N'1', N'1', N'1', N'2022-03-16 23:47:40.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1247', N'敏感词管理', N'', N'2', N'13', N'1', N'sensitive-word', N'education', N'system/sensitiveWord/index', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'1', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1248', N'敏感词查询', N'system:sensitive-word:query', N'3', N'1', N'1247', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1249', N'敏感词创建', N'system:sensitive-word:create', N'3', N'2', N'1247', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1250', N'敏感词更新', N'system:sensitive-word:update', N'3', N'3', N'1247', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1251', N'敏感词删除', N'system:sensitive-word:delete', N'3', N'4', N'1247', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1252', N'敏感词导出', N'system:sensitive-word:export', N'3', N'5', N'1247', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-07 16:55:03.0000000', N'', N'2022-04-20 17:03:10.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1254', N'作者动态', N'', N'1', N'0', N'0', N'https://www.iocoder.cn', N'people', N'', N'0', N'1', N'1', N'1', N'2022-04-23 01:03:15.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1255', N'数据源配置', N'', N'2', N'1', N'2', N'data-source-config', N'rate', N'infra/dataSourceConfig/index', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'1', N'2022-04-27 22:42:06.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1256', N'数据源配置查询', N'infra:data-source-config:query', N'3', N'1', N'1255', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'', N'2022-04-27 14:37:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1257', N'数据源配置创建', N'infra:data-source-config:create', N'3', N'2', N'1255', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'', N'2022-04-27 14:37:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1258', N'数据源配置更新', N'infra:data-source-config:update', N'3', N'3', N'1255', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'', N'2022-04-27 14:37:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1259', N'数据源配置删除', N'infra:data-source-config:delete', N'3', N'4', N'1255', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'', N'2022-04-27 14:37:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1260', N'数据源配置导出', N'infra:data-source-config:export', N'3', N'5', N'1255', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-04-27 14:37:32.0000000', N'', N'2022-04-27 14:37:32.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1261', N'OAuth 2.0', N'', N'1', N'10', N'1', N'oauth2', N'people', N'', N'0', N'1', N'1', N'1', N'2022-05-09 23:38:17.0000000', N'1', N'2022-05-12 18:11:34.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1263', N'应用管理', N'', N'2', N'0', N'1261', N'oauth2/application', N'tool', N'system/oauth2/client/index', N'0', N'1', N'1', N'', N'2022-05-10 16:26:33.0000000', N'1', N'2022-05-11 23:31:36.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1264', N'客户端查询', N'system:oauth2-client:query', N'3', N'1', N'1263', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-05-10 16:26:33.0000000', N'1', N'2022-05-11 00:31:06.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1265', N'客户端创建', N'system:oauth2-client:create', N'3', N'2', N'1263', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-05-10 16:26:33.0000000', N'1', N'2022-05-11 00:31:23.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1266', N'客户端更新', N'system:oauth2-client:update', N'3', N'3', N'1263', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-05-10 16:26:33.0000000', N'1', N'2022-05-11 00:31:28.0000000', N'0') +GO + +INSERT INTO [dbo].[system_menu] ([id], [name], [permission], [type], [sort], [parent_id], [path], [icon], [component], [status], [visible], [keep_alive], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1267', N'客户端删除', N'system:oauth2-client:delete', N'3', N'4', N'1263', N'', N'', N'', N'0', N'1', N'1', N'', N'2022-05-10 16:26:33.0000000', N'1', N'2022-05-11 00:31:33.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_menu] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_notice +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_notice]') AND type IN ('U')) + DROP TABLE [dbo].[system_notice] +GO + +CREATE TABLE [dbo].[system_notice] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [title] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [content] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] tinyint NOT NULL, + [status] tinyint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_notice] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'公告ID', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'公告标题', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'title' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'公告内容', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'公告类型(1通知 2公告)', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'公告状态(0正常 1关闭)', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_notice', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'通知公告表', +'SCHEMA', N'dbo', +'TABLE', N'system_notice' +GO + + +-- ---------------------------- +-- Records of system_notice +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_notice] ON +GO + +INSERT INTO [dbo].[system_notice] ([id], [title], [content], [type], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'温馨提醒:2018-07-01 若依新版本发布啦', N'

新版本内容133

', N'2', N'0', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-02-15 19:47:20.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_notice] ([id], [title], [content], [type], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'2', N'维护通知:2018-07-01 若依系统凌晨维护', N'维护内容', N'1', N'0', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2021-12-15 05:02:22.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_notice] ([id], [title], [content], [type], [status], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'4', N'我是测试标题', N'

哈哈哈哈123

', N'1', N'0', N'110', N'2022-02-22 01:01:25.0000000', N'110', N'2022-02-22 01:01:46.0000000', N'121', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_notice] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_oauth2_access_token +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_oauth2_access_token]') AND type IN ('U')) + DROP TABLE [dbo].[system_oauth2_access_token] +GO + +CREATE TABLE [dbo].[system_oauth2_access_token] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [access_token] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [refresh_token] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_type] tinyint NOT NULL, + [client_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [expires_time] datetime2(7) NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL, + [scopes] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL +) +GO + +ALTER TABLE [dbo].[system_oauth2_access_token] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'访问令牌', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'access_token' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'刷新令牌', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'refresh_token' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'client_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'过期时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'expires_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token', +'COLUMN', N'scopes' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'刷新令牌', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_access_token' +GO + + +-- ---------------------------- +-- Records of system_oauth2_access_token +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_access_token] ON +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_access_token] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_oauth2_approve +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_oauth2_approve]') AND type IN ('U')) + DROP TABLE [dbo].[system_oauth2_approve] +GO + +CREATE TABLE [dbo].[system_oauth2_approve] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [user_type] tinyint NOT NULL, + [client_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [scope] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [approved] varchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [expires_time] datetime2(7) NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint NOT NULL +) +GO + +ALTER TABLE [dbo].[system_oauth2_approve] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'client_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'scope' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否接受', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'approved' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'过期时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'expires_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'OAuth2 批准表', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_approve' +GO + + +-- ---------------------------- +-- Records of system_oauth2_approve +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_approve] ON +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_approve] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_oauth2_client +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_oauth2_client]') AND type IN ('U')) + DROP TABLE [dbo].[system_oauth2_client] +GO + +CREATE TABLE [dbo].[system_oauth2_client] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [client_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [secret] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [name] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [logo] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [description] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [access_token_validity_seconds] int NOT NULL, + [refresh_token_validity_seconds] int NOT NULL, + [redirect_uris] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [auto_approve_scopes] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL, + [authorized_grant_types] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [scopes] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL, + [authorities] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [resource_ids] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [additional_information] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_oauth2_client] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'client_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端密钥', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'secret' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用名', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用图标', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'logo' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'应用描述', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'description' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'访问令牌的有效期', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'access_token_validity_seconds' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'刷新令牌的有效期', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'refresh_token_validity_seconds' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'可重定向的 URI 地址', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'redirect_uris' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自动通过的授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'auto_approve_scopes' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权类型', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'authorized_grant_types' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'scopes' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'权限', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'authorities' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'资源', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'resource_ids' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'附加信息', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'additional_information' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'OAuth2 客户端表', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_client' +GO + + +-- ---------------------------- +-- Records of system_oauth2_client +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_client] ON +GO + +INSERT INTO [dbo].[system_oauth2_client] ([id], [client_id], [secret], [name], [logo], [description], [status], [access_token_validity_seconds], [refresh_token_validity_seconds], [redirect_uris], [auto_approve_scopes], [authorized_grant_types], [scopes], [authorities], [resource_ids], [additional_information], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'default', N'admin123', N'芋道源码', N'http://test.yudao.iocoder.cn/a5e2e244368878a366b516805a4aabf1.png', N'我是描述', N'0', N'180', N'8640', N'["https://www.iocoder.cn","https://doc.iocoder.cn"]', N'', N'["password","authorization_code","implicit","refresh_token"]', N'["user.read", "user.write"]', N'["system:user:query"]', N'[]', N'{}', N'1', N'2022-05-11 21:47:12.0000000', N'1', N'2022-05-13 10:50:16.9620000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_client] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_oauth2_code +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_oauth2_code]') AND type IN ('U')) + DROP TABLE [dbo].[system_oauth2_code] +GO + +CREATE TABLE [dbo].[system_oauth2_code] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [user_type] tinyint NOT NULL, + [code] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [client_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [scopes] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [expires_time] datetime2(7) NOT NULL, + [redirect_uri] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [state] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint NOT NULL +) +GO + +ALTER TABLE [dbo].[system_oauth2_code] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权码', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'client_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'scopes' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'过期时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'expires_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'可重定向的 URI 地址', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'redirect_uri' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'state' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'OAuth2 授权码表', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_code' +GO + + +-- ---------------------------- +-- Records of system_oauth2_code +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_code] ON +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_code] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_oauth2_refresh_token +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_oauth2_refresh_token]') AND type IN ('U')) + DROP TABLE [dbo].[system_oauth2_refresh_token] +GO + +CREATE TABLE [dbo].[system_oauth2_refresh_token] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [refresh_token] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_type] tinyint NOT NULL, + [client_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [expires_time] datetime2(7) NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint NOT NULL, + [scopes] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL +) +GO + +ALTER TABLE [dbo].[system_oauth2_refresh_token] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'刷新令牌', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'refresh_token' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户端编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'client_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'过期时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'expires_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'授权范围', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token', +'COLUMN', N'scopes' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'刷新令牌', +'SCHEMA', N'dbo', +'TABLE', N'system_oauth2_refresh_token' +GO + + +-- ---------------------------- +-- Records of system_oauth2_refresh_token +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_refresh_token] ON +GO + +SET IDENTITY_INSERT [dbo].[system_oauth2_refresh_token] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_operate_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_operate_log]') AND type IN ('U')) + DROP TABLE [dbo].[system_operate_log] +GO + +CREATE TABLE [dbo].[system_operate_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [trace_id] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_id] bigint NOT NULL, + [user_type] tinyint NOT NULL, + [module] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [type] bigint NOT NULL, + [content] nvarchar(2000) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL, + [exts] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NOT NULL, + [request_method] nvarchar(16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [request_url] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [user_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [user_agent] nvarchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [java_method] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [java_method_args] nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [start_time] datetime2(7) NOT NULL, + [duration] int NOT NULL, + [result_code] int NOT NULL, + [result_msg] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [result_data] nvarchar(4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_operate_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'日志主键', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'链路追踪编号', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'trace_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模块标题', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'module' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'操作名', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'操作分类', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'操作内容', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'拓展字段', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'exts' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求方法名', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'request_method' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'请求地址', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'request_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户 IP', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'user_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'浏览器 UA', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'user_agent' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Java 方法名', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'java_method' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'Java 方法的参数', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'java_method_args' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'操作时间', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'start_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'执行时长', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'duration' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果码', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'result_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果提示', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'result_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结果数据', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'result_data' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'操作日志记录', +'SCHEMA', N'dbo', +'TABLE', N'system_operate_log' +GO + + +-- ---------------------------- +-- Records of system_operate_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_operate_log] ON +GO + +SET IDENTITY_INSERT [dbo].[system_operate_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_post +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_post]') AND type IN ('U')) + DROP TABLE [dbo].[system_post] +GO + +CREATE TABLE [dbo].[system_post] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [code] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [name] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [sort] int NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_post] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位ID', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位编码', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位名称', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'显示顺序', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'sort' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_post', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位信息表', +'SCHEMA', N'dbo', +'TABLE', N'system_post' +GO + + +-- ---------------------------- +-- Records of system_post +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_post] ON +GO + +INSERT INTO [dbo].[system_post] ([id], [code], [name], [sort], [status], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'ceo', N'董事长', N'1', N'0', N'', N'admin', N'2021-01-06 17:03:48.0000000', N'1', N'2022-04-19 16:53:39.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_post] ([id], [code], [name], [sort], [status], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'2', N'se', N'项目经理', N'2', N'0', N'', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2021-12-12 10:47:47.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_post] ([id], [code], [name], [sort], [status], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'4', N'user', N'普通员工', N'4', N'0', N'111', N'admin', N'2021-01-05 17:03:48.0000000', N'1', N'2022-04-20 00:59:35.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_post] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_role +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_role]') AND type IN ('U')) + DROP TABLE [dbo].[system_role] +GO + +CREATE TABLE [dbo].[system_role] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [code] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [sort] int NOT NULL, + [data_scope] tinyint NOT NULL, + [data_scope_dept_ids] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [type] tinyint NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_role] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色ID', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色名称', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色权限字符串', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'显示顺序', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'sort' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'data_scope' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据范围(指定部门数组)', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'data_scope_dept_ids' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色类型', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_role', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色信息表', +'SCHEMA', N'dbo', +'TABLE', N'system_role' +GO + + +-- ---------------------------- +-- Records of system_role +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_role] ON +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'超级管理员', N'super_admin', N'1', N'1', N'', N'0', N'1', N'超级管理员', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-22 05:08:21.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'2', N'普通角色', N'common', N'2', N'2', N'', N'0', N'1', N'普通角色', N'admin', N'2021-01-05 17:03:48.0000000', N'', N'2022-02-22 05:08:20.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'101', N'测试账号', N'test', N'0', N'1', N'[]', N'0', N'2', N'132', N'', N'2021-01-06 13:49:35.0000000', N'1', N'2022-05-02 02:32:06.6180000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'109', N'租户管理员', N'tenant_admin', N'0', N'1', N'', N'0', N'1', N'系统自动生成', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-02-22 00:56:14.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'110', N'测试角色', N'test', N'0', N'1', N'[]', N'0', N'2', N'嘿嘿', N'110', N'2022-02-23 00:14:34.0000000', N'110', N'2022-02-23 13:14:58.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_role] ([id], [name], [code], [sort], [data_scope], [data_scope_dept_ids], [status], [type], [remark], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'111', N'租户管理员', N'tenant_admin', N'0', N'1', N'', N'0', N'1', N'系统自动生成', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_role] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_role_menu +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_role_menu]') AND type IN ('U')) + DROP TABLE [dbo].[system_role_menu] +GO + +CREATE TABLE [dbo].[system_role_menu] ( + [role_id] bigint NOT NULL, + [menu_id] bigint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [id] bigint IDENTITY(1,1) NOT NULL +) +GO + +ALTER TABLE [dbo].[system_role_menu] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色ID', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'role_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'menu_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自增编号', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色和菜单关联表', +'SCHEMA', N'dbo', +'TABLE', N'system_role_menu' +GO + + +-- ---------------------------- +-- Records of system_role_menu +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_role_menu] ON +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-02-22 00:56:14.0000000', N'121', N'0', N'1') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'2') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1093', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'3') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1094', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'4') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1100', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'5') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1107', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'6') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1110', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'7') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1117', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'8') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'100', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'9') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'101', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'10') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'102', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'11') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1126', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'12') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'103', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'13') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'104', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'14') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'105', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'15') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'107', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'16') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'108', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'17') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'109', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'18') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1138', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'19') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1224', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'20') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1225', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'21') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'500', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'22') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'501', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'2022-02-22 13:09:12.0000000', N'1', N'0', N'23') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'2', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'24') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1077', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'25') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1078', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'26') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1083', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'27') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1084', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'28') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'1090', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'29') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'106', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'30') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'110', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'31') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'111', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'32') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'112', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'33') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'2', N'113', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'2022-02-22 13:16:57.0000000', N'1', N'0', N'34') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'110', N'1', N'110', N'2022-02-23 00:23:55.0000000', N'110', N'2022-02-23 00:23:55.0000000', N'121', N'0', N'35') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'103', N'1', N'2022-02-23 19:32:14.0000000', N'1', N'2022-02-23 19:32:14.0000000', N'121', N'0', N'36') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'104', N'1', N'2022-02-23 19:32:14.0000000', N'1', N'2022-02-23 19:32:14.0000000', N'121', N'0', N'37') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'38') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'2', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'39') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1077', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'40') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1078', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'41') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1083', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'42') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1084', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'43') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1090', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'44') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1093', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'45') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1094', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'46') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1100', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'47') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1107', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'48') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1110', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'49') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1117', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'50') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'100', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'51') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'101', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'52') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'102', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'53') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1126', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'54') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'103', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'55') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'104', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'56') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'105', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'57') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'106', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'58') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'107', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'59') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'108', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'60') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'109', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'61') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'110', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'62') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'111', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'63') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'112', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'64') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'113', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'65') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1138', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'66') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1224', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'67') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'1225', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'68') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'500', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'69') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'1', N'501', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'2022-02-23 20:03:57.0000000', N'1', N'0', N'70') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1024', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'71') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1025', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'72') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1017', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'73') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1018', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'74') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1019', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'75') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1020', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'76') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1021', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'77') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1022', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'78') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1023', N'1', N'2022-02-23 20:30:14.0000000', N'1', N'2022-02-23 20:30:14.0000000', N'121', N'0', N'79') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1024', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'80') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1025', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'81') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'82') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'103', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'83') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'104', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'84') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1017', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'85') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1018', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'86') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1019', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'87') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1020', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'88') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1021', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'89') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1022', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'90') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1023', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0', N'91') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'102', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'121', N'0', N'92') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1013', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'121', N'0', N'93') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1014', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'121', N'0', N'94') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1015', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'121', N'0', N'95') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'109', N'1016', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'121', N'0', N'96') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'102', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'122', N'0', N'97') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1013', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'122', N'0', N'98') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1014', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'122', N'0', N'99') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1015', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'122', N'0', N'100') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'111', N'1016', N'1', N'2022-03-19 18:39:13.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'122', N'0', N'101') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1216', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'102') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1217', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'103') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1218', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'104') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1219', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'105') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1220', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'106') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1221', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'107') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'5', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'108') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1222', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'109') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1118', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'110') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1119', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'111') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1120', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'112') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1185', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'113') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1186', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'114') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1187', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'115') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1188', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'116') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1189', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'117') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1190', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'118') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1191', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'119') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1192', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'120') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1193', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'121') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1194', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'122') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1195', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'123') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1196', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'124') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1197', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'125') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1198', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'126') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1199', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'127') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1200', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'128') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1201', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'129') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1202', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'130') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1207', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'131') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1208', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'132') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1209', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'133') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1210', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'134') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1211', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'135') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1212', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'136') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1213', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'137') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1215', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'2022-03-19 21:45:52.0000000', N'1', N'0', N'138') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'2', N'1', N'2022-04-01 22:21:24.0000000', N'1', N'2022-04-01 22:21:24.0000000', N'1', N'0', N'139') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1031', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'140') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1032', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'141') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1033', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'142') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1034', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'143') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1035', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'144') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1050', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'145') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1051', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'146') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1052', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'147') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1053', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'148') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1054', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'149') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1056', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'150') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1057', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'151') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1058', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'152') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1059', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'153') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1060', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'154') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1066', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'155') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1067', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'156') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1070', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'157') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1071', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'158') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1072', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'159') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1073', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'160') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1074', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'161') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1075', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'162') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1076', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'163') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1077', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'164') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1078', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'165') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1082', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'166') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1083', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'167') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1084', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'168') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1085', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'169') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1086', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'170') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1087', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'171') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1088', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'172') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1089', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'173') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1090', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'174') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1091', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'175') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1092', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'176') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1237', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'177') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1238', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'178') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1239', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'179') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1240', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'180') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1241', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'181') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1242', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'182') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'1243', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'183') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'106', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'184') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'110', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'185') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'111', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'186') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'112', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'187') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'113', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'188') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'114', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'189') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'115', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'190') +GO + +INSERT INTO [dbo].[system_role_menu] ([role_id], [menu_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted], [id]) VALUES (N'101', N'116', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'2022-04-01 22:21:37.0000000', N'1', N'0', N'191') +GO + +SET IDENTITY_INSERT [dbo].[system_role_menu] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_sensitive_word +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_sensitive_word]') AND type IN ('U')) + DROP TABLE [dbo].[system_sensitive_word] +GO + +CREATE TABLE [dbo].[system_sensitive_word] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [description] nvarchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [tags] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_sensitive_word] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'敏感词', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'描述', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'description' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'标签数组', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'tags' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'敏感词', +'SCHEMA', N'dbo', +'TABLE', N'system_sensitive_word' +GO + + +-- ---------------------------- +-- Records of system_sensitive_word +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_sensitive_word] ON +GO + +INSERT INTO [dbo].[system_sensitive_word] ([id], [name], [description], [tags], [status], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'3', N'土豆', N'好呀', N'蔬菜,短信', N'0', N'1', N'2022-04-08 21:07:12.0000000', N'1', N'2022-04-09 10:28:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sensitive_word] ([id], [name], [description], [tags], [status], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'4', N'XXX', NULL, N'短信', N'0', N'1', N'2022-04-08 21:27:49.0000000', N'1', N'2022-04-08 21:27:49.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_sensitive_word] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_sms_channel +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_sms_channel]') AND type IN ('U')) + DROP TABLE [dbo].[system_sms_channel] +GO + +CREATE TABLE [dbo].[system_sms_channel] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [signature] nvarchar(12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_key] nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [api_secret] nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [callback_url] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_sms_channel] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信签名', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'signature' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 的账号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'api_key' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 的秘钥', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'api_secret' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信发送回调 URL', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'callback_url' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信渠道', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_channel' +GO + + +-- ---------------------------- +-- Records of system_sms_channel +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_sms_channel] ON +GO + +INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'芋道', N'YUN_PIAN', N'0', N'呵呵呵哒', N'1555a14277cb8a608cf45a9e6a80d510', NULL, N'http://vdwapu.natappfree.cc/admin-api/system/sms/callback/yunpian', N'', N'2021-03-31 06:12:20.0000000', N'1', N'2022-02-23 16:48:44.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'Ballcat', N'ALIYUN', N'0', N'啦啦啦', N'LTAI5tCnKso2uG3kJ5gRav88', N'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, N'', N'2021-03-31 11:53:10.0000000', N'1', N'2021-04-14 00:08:37.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'4', N'测试渠道', N'DEBUG_DING_TALK', N'0', N'123', N'696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', N'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, N'1', N'2021-04-13 00:23:14.0000000', N'1', N'2022-03-27 20:29:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'6', N'测试演示', N'DEBUG_DING_TALK', N'0', NULL, N'696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', N'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, N'1', N'2022-04-10 23:07:59.0000000', N'1', N'2022-04-10 23:07:59.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_sms_channel] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_sms_code +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_sms_code]') AND type IN ('U')) + DROP TABLE [dbo].[system_sms_code] +GO + +CREATE TABLE [dbo].[system_sms_code] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [mobile] nvarchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [code] nvarchar(6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [create_ip] nvarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [scene] tinyint NOT NULL, + [today_index] tinyint NOT NULL, + [used] tinyint NOT NULL, + [used_time] datetime2(7) NULL, + [used_ip] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_sms_code] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'mobile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'验证码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建 IP', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'create_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送场景', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'scene' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'今日发送的第几条', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'today_index' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否使用', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'used' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'使用时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'used_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'使用 IP', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'used_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机验证码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_code' +GO + + +-- ---------------------------- +-- Records of system_sms_code +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_sms_code] ON +GO + +SET IDENTITY_INSERT [dbo].[system_sms_code] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_sms_log +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_sms_log]') AND type IN ('U')) + DROP TABLE [dbo].[system_sms_log] +GO + +CREATE TABLE [dbo].[system_sms_log] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [channel_id] bigint NOT NULL, + [channel_code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [template_id] bigint NOT NULL, + [template_code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [template_type] tinyint NOT NULL, + [template_content] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [template_params] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [api_template_id] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [mobile] nvarchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [user_id] bigint NULL, + [user_type] tinyint NULL, + [send_status] tinyint NOT NULL, + [send_time] datetime2(7) NULL, + [send_code] int NULL, + [send_msg] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_send_code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_send_msg] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_request_id] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_serial_no] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [receive_status] tinyint NOT NULL, + [receive_time] datetime2(7) NULL, + [api_receive_code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_receive_msg] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_sms_log] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信渠道编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'channel_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'channel_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'template_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'template_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信类型', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'template_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信内容', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'template_content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信参数', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'template_params' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 的模板编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_template_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'mobile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送状态', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'send_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'send_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送结果的编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'send_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送结果的提示', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'send_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 发送结果的编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_send_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 发送失败的提示', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_send_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 发送返回的唯一请求 ID', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_request_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 发送返回的序号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_serial_no' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'接收状态', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'receive_status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'接收时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'receive_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'API 接收结果的编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_receive_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'API 接收结果的说明', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'api_receive_msg' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信日志', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_log' +GO + + +-- ---------------------------- +-- Records of system_sms_log +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_sms_log] ON +GO + +SET IDENTITY_INSERT [dbo].[system_sms_log] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_sms_template +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_sms_template]') AND type IN ('U')) + DROP TABLE [dbo].[system_sms_template] +GO + +CREATE TABLE [dbo].[system_sms_template] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [type] tinyint NOT NULL, + [status] tinyint NOT NULL, + [code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [name] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [content] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [params] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [remark] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [api_template_id] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [channel_id] bigint NOT NULL, + [channel_code] nvarchar(63) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_sms_template] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信签名', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开启状态', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板名称', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'模板内容', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'参数数组', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'params' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信 API 的模板编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'api_template_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信渠道编号', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'channel_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信渠道编码', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'channel_code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'短信模板', +'SCHEMA', N'dbo', +'TABLE', N'system_sms_template' +GO + + +-- ---------------------------- +-- Records of system_sms_template +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_sms_template] ON +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'1', N'0', N'test_01', N'测试验证码短信', N'正在进行登录操作{operation},您的验证码是{code}', N'["operation","code"]', NULL, N'4383920', N'1', N'YUN_PIAN', N'', N'2021-03-31 10:49:38.0000000', N'1', N'2021-04-10 01:22:00.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'3', N'1', N'0', N'test_02', N'公告通知', N'您的验证码{code},该验证码5分钟内有效,请勿泄漏于他人!', N'["code"]', NULL, N'SMS_207945135', N'2', N'ALIYUN', N'', N'2021-03-31 11:56:30.0000000', N'1', N'2021-04-10 01:22:02.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'6', N'3', N'0', N'test-01', N'测试模板', N'哈哈哈 {name}', N'["name"]', N'f哈哈哈', N'4383920', N'1', N'YUN_PIAN', N'1', N'2021-04-10 01:07:21.0000000', N'1', N'2021-04-10 01:22:05.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'7', N'3', N'0', N'test-04', N'测试下', N'老鸡{name},牛逼{code}', N'["name","code"]', NULL, N'suibian', N'4', N'DEBUG_DING_TALK', N'1', N'2021-04-13 00:29:53.0000000', N'1', N'2021-04-14 00:30:38.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'8', N'1', N'0', N'user-sms-login', N'前台用户短信登录', N'您的验证码是{code}', N'["code"]', NULL, N'4372216', N'1', N'YUN_PIAN', N'1', N'2021-10-11 08:10:00.0000000', N'1', N'2021-10-11 08:10:00.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'9', N'2', N'0', N'bpm_task_assigned', N'【工作流】任务被分配', N'您收到了一条新的待办任务:{processInstanceName}-{taskName},申请人:{startUserNickname},处理链接:{detailUrl}', N'["processInstanceName","taskName","startUserNickname","detailUrl"]', NULL, N'suibian', N'4', N'DEBUG_DING_TALK', N'1', N'2022-01-21 22:31:19.0000000', N'1', N'2022-01-22 00:03:36.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'10', N'2', N'0', N'bpm_process_instance_reject', N'【工作流】流程被不通过', N'您的流程被审批不通过:{processInstanceName},原因:{reason},查看链接:{detailUrl}', N'["processInstanceName","reason","detailUrl"]', NULL, N'suibian', N'4', N'DEBUG_DING_TALK', N'1', N'2022-01-22 00:03:31.0000000', N'1', N'2022-05-01 12:33:14.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'11', N'2', N'0', N'bpm_process_instance_approve', N'【工作流】流程被通过', N'您的流程被审批通过:{processInstanceName},查看链接:{detailUrl}', N'["processInstanceName","detailUrl"]', NULL, N'suibian', N'4', N'DEBUG_DING_TALK', N'1', N'2022-01-22 00:04:31.0000000', N'1', N'2022-03-27 20:32:21.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'12', N'2', N'0', N'demo', N'演示模板', N'我就是测试一下下', N'[]', NULL, N'biubiubiu', N'6', N'DEBUG_DING_TALK', N'1', N'2022-04-10 23:22:49.0000000', N'1', N'2022-04-10 23:22:49.0000000', N'0') +GO + +INSERT INTO [dbo].[system_sms_template] ([id], [type], [status], [code], [name], [content], [params], [remark], [api_template_id], [channel_id], [channel_code], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'13', N'1', N'0', N'admin-sms-login', N'后台用户短信登录', N'您的验证码是{code}', N'["code"]', N'', N'4372216', N'1', N'YUN_PIAN', N'1', N'2021-10-11 08:10:00.0000000', N'1', N'2021-10-11 08:10:00.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_sms_template] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_social_user +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_social_user]') AND type IN ('U')) + DROP TABLE [dbo].[system_social_user] +GO + +CREATE TABLE [dbo].[system_social_user] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [type] tinyint NOT NULL, + [openid] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [token] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [raw_token_info] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [nickname] nvarchar(32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [avatar] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [raw_user_info] nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [code] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [state] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_social_user] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'主键(自增策略)', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交平台的类型', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交 openid', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'openid' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交 token', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'token' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'原始 Token 数据,一般是 JSON 格式', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'raw_token_info' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户昵称', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'nickname' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户头像', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'avatar' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'原始用户数据,一般是 JSON 格式', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'raw_user_info' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后一次的认证 code', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后一次的认证 state', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'state' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交用户表', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user' +GO + + +-- ---------------------------- +-- Records of system_social_user +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_social_user] ON +GO + +SET IDENTITY_INSERT [dbo].[system_social_user] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_social_user_bind +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_social_user_bind]') AND type IN ('U')) + DROP TABLE [dbo].[system_social_user_bind] +GO + +CREATE TABLE [dbo].[system_social_user_bind] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [user_type] tinyint NOT NULL, + [social_type] tinyint NOT NULL, + [social_user_id] bigint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_social_user_bind] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'主键(自增策略)', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户类型', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'user_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交平台的类型', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'social_type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交用户的编号', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'social_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'社交绑定表', +'SCHEMA', N'dbo', +'TABLE', N'system_social_user_bind' +GO + + +-- ---------------------------- +-- Records of system_social_user_bind +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_social_user_bind] ON +GO + +SET IDENTITY_INSERT [dbo].[system_social_user_bind] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_tenant +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_tenant]') AND type IN ('U')) + DROP TABLE [dbo].[system_tenant] +GO + +CREATE TABLE [dbo].[system_tenant] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [contact_user_id] bigint NULL, + [contact_name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [contact_mobile] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [domain] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [package_id] bigint NOT NULL, + [expire_time] datetime2(7) NOT NULL, + [account_count] int NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_tenant] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户名', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系人的用户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'contact_user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系人', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'contact_name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系手机', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'contact_mobile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'绑定域名', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'domain' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户套餐编号', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'package_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'过期时间', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'expire_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'账号数量', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'account_count' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户表', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant' +GO + + +-- ---------------------------- +-- Records of system_tenant +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_tenant] ON +GO + +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'芋道源码', NULL, N'芋艿', N'17321315478', N'0', N'https://www.iocoder.cn', N'0', N'2099-02-19 17:14:16.0000000', N'9999', N'1', N'2021-01-05 17:03:47.0000000', N'1', N'2022-02-23 12:15:11.0000000', N'0') +GO + +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'121', N'小租户', N'110', N'小王2', N'15601691300', N'0', N'http://www.iocoder.cn', N'111', N'2024-03-11 00:00:00.0000000', N'20', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-03-19 18:37:20.0000000', N'0') +GO + +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'122', N'测试租户', N'113', N'芋道', N'15601691300', N'0', N'https://www.iocoder.cn', N'111', N'2022-04-30 00:00:00.0000000', N'50', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_tenant] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_tenant_package +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_tenant_package]') AND type IN ('U')) + DROP TABLE [dbo].[system_tenant_package] +GO + +CREATE TABLE [dbo].[system_tenant_package] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [status] tinyint NOT NULL, + [remark] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [menu_ids] nvarchar(2048) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_tenant_package] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'套餐编号', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'套餐名', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'关联的菜单编号', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'menu_ids' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户套餐表', +'SCHEMA', N'dbo', +'TABLE', N'system_tenant_package' +GO + + +-- ---------------------------- +-- Records of system_tenant_package +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_tenant_package] ON +GO + +INSERT INTO [dbo].[system_tenant_package] ([id], [name], [status], [remark], [menu_ids], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'111', N'普通套餐', N'0', N'小功能', N'[1024,1025,1,102,103,104,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023]', N'1', N'2022-02-22 00:54:00.0000000', N'1', N'2022-03-19 18:39:13.0000000', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_tenant_package] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_user_post +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_user_post]') AND type IN ('U')) + DROP TABLE [dbo].[system_user_post] +GO + +CREATE TABLE [dbo].[system_user_post] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [post_id] bigint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL, + [tenant_id] bigint DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_user_post] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'ID 主键', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户ID', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位ID', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'post_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户岗位表', +'SCHEMA', N'dbo', +'TABLE', N'system_user_post' +GO + + +-- ---------------------------- +-- Records of system_user_post +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_user_post] ON +GO + +INSERT INTO [dbo].[system_user_post] ([id], [user_id], [post_id], [creator], [create_time], [updater], [update_time], [deleted], [tenant_id]) VALUES (N'112', N'1', N'1', N'admin', N'2022-05-02 07:25:24.0000000', N'admin', N'2022-05-02 07:25:24.0000000', N'0', N'1') +GO + +INSERT INTO [dbo].[system_user_post] ([id], [user_id], [post_id], [creator], [create_time], [updater], [update_time], [deleted], [tenant_id]) VALUES (N'113', N'100', N'1', N'admin', N'2022-05-02 07:25:24.0000000', N'admin', N'2022-05-02 07:25:24.0000000', N'0', N'1') +GO + +INSERT INTO [dbo].[system_user_post] ([id], [user_id], [post_id], [creator], [create_time], [updater], [update_time], [deleted], [tenant_id]) VALUES (N'114', N'114', N'3', N'admin', N'2022-05-02 07:25:24.0000000', N'admin', N'2022-05-02 07:25:24.0000000', N'0', N'1') +GO + +SET IDENTITY_INSERT [dbo].[system_user_post] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_user_role +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_user_role]') AND type IN ('U')) + DROP TABLE [dbo].[system_user_role] +GO + +CREATE TABLE [dbo].[system_user_role] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [user_id] bigint NOT NULL, + [role_id] bigint NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_user_role] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自增编号', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户ID', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色ID', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'role_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户和角色关联表', +'SCHEMA', N'dbo', +'TABLE', N'system_user_role' +GO + + +-- ---------------------------- +-- Records of system_user_role +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_user_role] ON +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'1', N'1', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'2', N'2', N'2', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'4', N'100', N'101', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'5', N'100', N'1', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'6', N'100', N'2', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'7', N'104', N'101', N'', N'2022-01-11 13:19:45.0000000', N'', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'10', N'103', N'1', N'1', N'2022-01-11 13:19:45.0000000', N'1', N'2022-01-11 13:19:45.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'11', N'107', N'106', N'1', N'2022-02-20 22:59:33.0000000', N'1', N'2022-02-20 22:59:33.0000000', N'118', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'12', N'108', N'107', N'1', N'2022-02-20 23:00:50.0000000', N'1', N'2022-02-20 23:00:50.0000000', N'119', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'13', N'109', N'108', N'1', N'2022-02-20 23:11:50.0000000', N'1', N'2022-02-20 23:11:50.0000000', N'120', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'14', N'110', N'109', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-02-22 00:56:14.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'15', N'111', N'110', N'110', N'2022-02-23 13:14:38.0000000', N'110', N'2022-02-23 13:14:38.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'16', N'113', N'111', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'122', N'0') +GO + +INSERT INTO [dbo].[system_user_role] ([id], [user_id], [role_id], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'17', N'114', N'101', N'1', N'2022-03-19 21:51:13.0000000', N'1', N'2022-03-19 21:51:13.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_user_role] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for system_users +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[system_users]') AND type IN ('U')) + DROP TABLE [dbo].[system_users] +GO + +CREATE TABLE [dbo].[system_users] ( + [id] bigint IDENTITY(1,1) NOT NULL, + [username] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [password] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [nickname] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [dept_id] bigint NULL, + [post_ids] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [email] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [mobile] nvarchar(11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [sex] tinyint NULL, + [avatar] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [status] tinyint NOT NULL, + [login_ip] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [login_date] datetime2(7) NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [create_time] datetime2(7) NOT NULL, + [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, + [update_time] datetime2(7) NOT NULL, + [tenant_id] bigint NOT NULL, + [deleted] bit DEFAULT 0 NOT NULL +) +GO + +ALTER TABLE [dbo].[system_users] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户ID', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户账号', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'username' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'密码', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'password' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户昵称', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'nickname' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'部门ID', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'dept_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'岗位编号数组', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'post_ids' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户邮箱', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'email' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号码', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'mobile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户性别', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'sex' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'头像地址', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'avatar' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'帐号状态(0正常 1停用)', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后登录IP', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'login_ip' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后登录时间', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'login_date' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建者', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'creator' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'updater' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'租户编号', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'tenant_id' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否删除', +'SCHEMA', N'dbo', +'TABLE', N'system_users', +'COLUMN', N'deleted' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户信息表', +'SCHEMA', N'dbo', +'TABLE', N'system_users' +GO + + +-- ---------------------------- +-- Records of system_users +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[system_users] ON +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'1', N'admin', N'$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', N'芋道源码', N'管理员', N'103', N'[1]', N'aoteman@126.com', N'15612345678', N'1', N'http://test.yudao.iocoder.cn/48934f2f-92d4-4250-b917-d10d2b262c6a', N'0', N'127.0.0.1', N'2022-05-26 00:51:15.3820000', N'admin', N'2021-01-05 17:03:47.0000000', NULL, N'2022-05-26 00:51:15.3870000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'100', N'yudao', N'$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', N'芋道', N'不要吓我', N'104', N'[1]', N'yudao@iocoder.cn', N'15601691300', N'1', N'', N'1', N'127.0.0.1', N'2022-05-03 16:49:24.6860000', N'', N'2021-01-07 09:07:17.0000000', NULL, N'2022-05-03 16:49:24.6860000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'103', N'yuanma', N'$2a$10$wWoPT7sqriM2O1YXRL.je.GiL538OR6ZTN8aQZr9JAGdnpCH2tpYe', N'源码', NULL, N'106', NULL, N'yuanma@iocoder.cn', N'15601701300', N'0', N'', N'0', N'127.0.0.1', N'2022-01-18 00:33:40.0000000', N'', N'2021-01-13 23:50:35.0000000', NULL, N'2022-01-18 00:33:40.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'104', N'test', N'$2a$10$e5RpuDCC0GYSt0Hvd2.CjujIXwgGct4SnXi6dVGxdgFsnqgEryk5a', N'测试号', NULL, N'107', N'[]', N'111@qq.com', N'15601691200', N'1', N'', N'0', N'127.0.0.1', N'2022-03-19 21:46:19.0000000', N'', N'2021-01-21 02:13:53.0000000', NULL, N'2022-03-19 21:46:19.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'107', N'admin107', N'$2a$10$dYOOBKMO93v/.ReCqzyFg.o67Tqk.bbc2bhrpyBGkIw9aypCtr2pm', N'芋艿', NULL, NULL, NULL, N'', N'15601691300', N'0', N'', N'0', N'', NULL, N'1', N'2022-02-20 22:59:33.0000000', N'1', N'2022-02-27 08:26:51.0000000', N'118', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'108', N'admin108', N'$2a$10$y6mfvKoNYL1GXWak8nYwVOH.kCWqjactkzdoIDgiKl93WN3Ejg.Lu', N'芋艿', NULL, NULL, NULL, N'', N'15601691300', N'0', N'', N'0', N'', NULL, N'1', N'2022-02-20 23:00:50.0000000', N'1', N'2022-02-27 08:26:53.0000000', N'119', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'109', N'admin109', N'$2a$10$JAqvH0tEc0I7dfDVBI7zyuB4E3j.uH6daIjV53.vUS6PknFkDJkuK', N'芋艿', NULL, NULL, NULL, N'', N'15601691300', N'0', N'', N'0', N'', NULL, N'1', N'2022-02-20 23:11:50.0000000', N'1', N'2022-02-27 08:26:56.0000000', N'120', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'110', N'admin110', N'$2a$10$qYxoXs0ogPHgYllyEneYde9xcCW5hZgukrxeXZ9lmLhKse8TK6IwW', N'小王', NULL, NULL, NULL, N'', N'15601691300', N'0', N'', N'0', N'127.0.0.1', N'2022-02-23 19:36:28.0000000', N'1', N'2022-02-22 00:56:14.0000000', NULL, N'2022-02-27 08:26:59.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'111', N'test', N'$2a$10$mExveopHUx9Q4QiLtAzhDeH3n4/QlNLzEsM4AqgxKrU.ciUZDXZCy', N'测试用户', NULL, NULL, N'[]', N'', N'', N'0', N'', N'0', N'', NULL, N'110', N'2022-02-23 13:14:33.0000000', N'110', N'2022-02-23 13:14:33.0000000', N'121', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'112', N'newobject', N'$2a$10$jh5MsR.ud/gKe3mVeUp5t.nEXGDSmHyv5OYjWQwHO8wlGmMSI9Twy', N'新对象', NULL, NULL, N'[]', N'', N'', N'0', N'', N'0', N'', NULL, N'1', N'2022-02-23 19:08:03.0000000', N'1', N'2022-02-23 19:08:03.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'113', N'aoteman', N'$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', N'芋道', NULL, NULL, NULL, N'', N'15601691300', N'0', N'', N'0', N'127.0.0.1', N'2022-03-19 18:38:51.0000000', N'1', N'2022-03-07 21:37:58.0000000', NULL, N'2022-03-19 18:38:51.0000000', N'122', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'114', N'hrmgr', N'$2a$10$TR4eybBioGRhBmDBWkqWLO6NIh3mzYa8KBKDDB5woiGYFVlRAi.fu', N'hr 小姐姐', NULL, NULL, N'[3]', N'', N'', N'0', N'', N'0', N'127.0.0.1', N'2022-03-19 22:15:43.0000000', N'1', N'2022-03-19 21:50:58.0000000', NULL, N'2022-03-19 22:15:43.0000000', N'1', N'0') +GO + +INSERT INTO [dbo].[system_users] ([id], [username], [password], [nickname], [remark], [dept_id], [post_ids], [email], [mobile], [sex], [avatar], [status], [login_ip], [login_date], [creator], [create_time], [updater], [update_time], [tenant_id], [deleted]) VALUES (N'115', N'aotemane', N'$2a$10$/WCwGHu1eq0wOVDd/u8HweJ0gJCHyLS6T7ndCqI8UXZAQom1etk2e', N'1', N'11', N'100', N'[]', N'', N'', N'0', N'', N'0', N'', NULL, N'1', N'2022-04-30 02:55:43.0000000', N'1', N'2022-04-30 02:55:43.0000000', N'1', N'0') +GO + +SET IDENTITY_INSERT [dbo].[system_users] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_CALENDARS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_CALENDARS] ADD CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [CALENDAR_NAME]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Indexes structure for table QRTZ_CRON_TRIGGERS +-- ---------------------------- +CREATE NONCLUSTERED INDEX [IX_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] +ON [dbo].[QRTZ_CRON_TRIGGERS] ( + [SCHED_NAME] ASC, + [TRIGGER_NAME] ASC, + [TRIGGER_GROUP] ASC +) +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_CRON_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_FIRED_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [ENTRY_ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_JOB_DETAILS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] ADD CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [JOB_NAME], [JOB_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_LOCKS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_LOCKS] ADD CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [LOCK_NAME]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_PAUSED_TRIGGER_GRPS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] ADD CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_SCHEDULER_STATE +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] ADD CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED ([SCHED_NAME], [INSTANCE_NAME]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Indexes structure for table QRTZ_SIMPLE_TRIGGERS +-- ---------------------------- +CREATE NONCLUSTERED INDEX [IX_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] +ON [dbo].[QRTZ_SIMPLE_TRIGGERS] ( + [SCHED_NAME] ASC, + [TRIGGER_NAME] ASC, + [TRIGGER_GROUP] ASC +) +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_SIMPLE_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Indexes structure for table QRTZ_SIMPROP_TRIGGERS +-- ---------------------------- +CREATE NONCLUSTERED INDEX [IX_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] +ON [dbo].[QRTZ_SIMPROP_TRIGGERS] ( + [SCHED_NAME] ASC, + [TRIGGER_NAME] ASC, + [TRIGGER_GROUP] ASC +) +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_SIMPROP_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Indexes structure for table QRTZ_TRIGGERS +-- ---------------------------- +CREATE NONCLUSTERED INDEX [IX_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] +ON [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME] ASC, + [TRIGGER_NAME] ASC, + [TRIGGER_GROUP] ASC +) +GO + + +-- ---------------------------- +-- Primary Key structure for table QRTZ_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_form +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_form]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_form +-- ---------------------------- +ALTER TABLE [dbo].[bpm_form] ADD CONSTRAINT [PK__bpm_form__3213E83F86C2B27F] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_oa_leave +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_oa_leave]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_oa_leave +-- ---------------------------- +ALTER TABLE [dbo].[bpm_oa_leave] ADD CONSTRAINT [PK__bpm_oa_l__3213E83F3569F596] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_process_definition_ext +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_process_definition_ext]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_process_definition_ext +-- ---------------------------- +ALTER TABLE [dbo].[bpm_process_definition_ext] ADD CONSTRAINT [PK__bpm_proc__3213E83F0A8AB015] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_process_instance_ext +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_process_instance_ext]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_process_instance_ext +-- ---------------------------- +ALTER TABLE [dbo].[bpm_process_instance_ext] ADD CONSTRAINT [PK__bpm_proc__3213E83FFD88328F] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_task_assign_rule +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_task_assign_rule]', RESEED, 2) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_task_assign_rule +-- ---------------------------- +ALTER TABLE [dbo].[bpm_task_assign_rule] ADD CONSTRAINT [PK__bpm_task__3213E83F474371C5] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_task_ext +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_task_ext]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_task_ext +-- ---------------------------- +ALTER TABLE [dbo].[bpm_task_ext] ADD CONSTRAINT [PK__bpm_task__3213E83FD8AFE1F9] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for bpm_user_group +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[bpm_user_group]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table bpm_user_group +-- ---------------------------- +ALTER TABLE [dbo].[bpm_user_group] ADD CONSTRAINT [PK__bpm_user__3213E83F25E4725B] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_api_access_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_api_access_log]', RESEED, 40615) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_api_access_log +-- ---------------------------- +ALTER TABLE [dbo].[infra_api_access_log] ADD CONSTRAINT [PK__infra_ap__3213E83F04F27A05] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_api_error_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_api_error_log]', RESEED, 2021) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_api_error_log +-- ---------------------------- +ALTER TABLE [dbo].[infra_api_error_log] ADD CONSTRAINT [PK__infra_ap__3213E83FCA2446D4] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_codegen_column +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_codegen_column]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_codegen_column +-- ---------------------------- +ALTER TABLE [dbo].[infra_codegen_column] ADD CONSTRAINT [PK__infra_co__3213E83FA9EC5005] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_codegen_table +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_codegen_table]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_codegen_table +-- ---------------------------- +ALTER TABLE [dbo].[infra_codegen_table] ADD CONSTRAINT [PK__infra_co__3213E83F555031D0] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_config +-- ---------------------------- +ALTER TABLE [dbo].[infra_config] ADD CONSTRAINT [PK__infra_co__3213E83FF4C71E85] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_data_source_config +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_data_source_config]', RESEED, 9) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_data_source_config +-- ---------------------------- +ALTER TABLE [dbo].[infra_data_source_config] ADD CONSTRAINT [PK__infra_da__3213E83F02D21AEB] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_file +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_file]', RESEED, 1) +GO + + +-- ---------------------------- +-- Auto increment value for infra_file_config +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_file_config]', RESEED, 11) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_file_config +-- ---------------------------- +ALTER TABLE [dbo].[infra_file_config] ADD CONSTRAINT [PK__infra_fi__3213E83F8A7903EA] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_file_content +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_file_content]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_file_content +-- ---------------------------- +ALTER TABLE [dbo].[infra_file_content] ADD CONSTRAINT [PK__infra_fi__3213E83F033E6045] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_job +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_job]', RESEED, 16) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_job +-- ---------------------------- +ALTER TABLE [dbo].[infra_job] ADD CONSTRAINT [PK__infra_jo__3213E83F3C7DE10C] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_job_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_job_log]', RESEED, 16) +GO + + +-- ---------------------------- +-- Primary Key structure for table infra_job_log +-- ---------------------------- +ALTER TABLE [dbo].[infra_job_log] ADD CONSTRAINT [PK__infra_jo__3213E83F4CA8F353] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for infra_test_demo +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[infra_test_demo]', RESEED, 1) +GO + + +-- ---------------------------- +-- Auto increment value for member_user +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[member_user]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table member_user +-- ---------------------------- +ALTER TABLE [dbo].[member_user] ADD CONSTRAINT [PK__member_u__3213E83F0A9AEC0B] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_app +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_app]', RESEED, 6) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_app +-- ---------------------------- +ALTER TABLE [dbo].[pay_app] ADD CONSTRAINT [PK__pay_app__3213E83FB26E0A6B] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_channel +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_channel]', RESEED, 17) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_channel +-- ---------------------------- +ALTER TABLE [dbo].[pay_channel] ADD CONSTRAINT [PK__pay_chan__3213E83F2556A7FC] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_merchant +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_merchant]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_merchant +-- ---------------------------- +ALTER TABLE [dbo].[pay_merchant] ADD CONSTRAINT [PK__pay_merc__3213E83F010D02B8] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_notify_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_notify_log]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_notify_log +-- ---------------------------- +ALTER TABLE [dbo].[pay_notify_log] ADD CONSTRAINT [PK__pay_noti__3213E83F5F4B3447] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_notify_task +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_notify_task]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_notify_task +-- ---------------------------- +ALTER TABLE [dbo].[pay_notify_task] ADD CONSTRAINT [PK__pay_noti__3213E83FB9215103] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_order +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_order]', RESEED, 124) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_order +-- ---------------------------- +ALTER TABLE [dbo].[pay_order] ADD CONSTRAINT [PK__pay_orde__3213E83F34C95271] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_order_extension +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_order_extension]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_order_extension +-- ---------------------------- +ALTER TABLE [dbo].[pay_order_extension] ADD CONSTRAINT [PK__pay_orde__3213E83F5ACB776F] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for pay_refund +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[pay_refund]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table pay_refund +-- ---------------------------- +ALTER TABLE [dbo].[pay_refund] ADD CONSTRAINT [PK__pay_refu__3213E83FBE1B54AC] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_dept +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_dept]', RESEED, 111) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_dept +-- ---------------------------- +ALTER TABLE [dbo].[system_dept] ADD CONSTRAINT [PK__system_d__3213E83FFA72847C] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_dict_data +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_dict_data]', RESEED, 1160) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_dict_data +-- ---------------------------- +ALTER TABLE [dbo].[system_dict_data] ADD CONSTRAINT [PK__system_d__3213E83F20407597] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_dict_type +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_dict_type]', RESEED, 147) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_dict_type +-- ---------------------------- +ALTER TABLE [dbo].[system_dict_type] ADD CONSTRAINT [PK__system_d__3213E83F7C36B1FD] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_error_code +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_error_code]', RESEED, 15466) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_error_code +-- ---------------------------- +ALTER TABLE [dbo].[system_error_code] ADD CONSTRAINT [PK__system_e__3213E83F68B8DFD0] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_login_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_login_log]', RESEED, 24) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_login_log +-- ---------------------------- +ALTER TABLE [dbo].[system_login_log] ADD CONSTRAINT [PK__system_l__3213E83F717953E9] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_menu +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_menu]', RESEED, 1267) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_menu +-- ---------------------------- +ALTER TABLE [dbo].[system_menu] ADD CONSTRAINT [PK__system_m__3213E83F14175801] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_notice +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_notice]', RESEED, 4) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_notice +-- ---------------------------- +ALTER TABLE [dbo].[system_notice] ADD CONSTRAINT [PK__system_n__3213E83FA158BA8D] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_oauth2_access_token +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_oauth2_access_token]', RESEED, 5) +GO + + +-- ---------------------------- +-- Auto increment value for system_oauth2_approve +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_oauth2_approve]', RESEED, 2) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_oauth2_approve +-- ---------------------------- +ALTER TABLE [dbo].[system_oauth2_approve] ADD CONSTRAINT [PK__system_o__3213E83F7CC08ED6] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_oauth2_client +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_oauth2_client]', RESEED, 1) +GO + + +-- ---------------------------- +-- Auto increment value for system_oauth2_code +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_oauth2_code]', RESEED, 4) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_oauth2_code +-- ---------------------------- +ALTER TABLE [dbo].[system_oauth2_code] ADD CONSTRAINT [PK__system_o__3213E83F38C13543] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_oauth2_refresh_token +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_oauth2_refresh_token]', RESEED, 3) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_oauth2_refresh_token +-- ---------------------------- +ALTER TABLE [dbo].[system_oauth2_refresh_token] ADD CONSTRAINT [PK__system_o__3213E83FCFB541CC] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_operate_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_operate_log]', RESEED, 19) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_operate_log +-- ---------------------------- +ALTER TABLE [dbo].[system_operate_log] ADD CONSTRAINT [PK__system_o__3213E83F85EC81FD] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_post +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_post]', RESEED, 4) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_post +-- ---------------------------- +ALTER TABLE [dbo].[system_post] ADD CONSTRAINT [PK__system_p__3213E83FBC098F34] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_role +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_role]', RESEED, 111) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_role +-- ---------------------------- +ALTER TABLE [dbo].[system_role] ADD CONSTRAINT [PK__system_r__3213E83F209B43F2] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_role_menu +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_role_menu]', RESEED, 191) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_role_menu +-- ---------------------------- +ALTER TABLE [dbo].[system_role_menu] ADD CONSTRAINT [PK__system_r__3213E83F6F1E4A9B] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_sensitive_word +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_sensitive_word]', RESEED, 4) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_sensitive_word +-- ---------------------------- +ALTER TABLE [dbo].[system_sensitive_word] ADD CONSTRAINT [PK__system_s__3213E83FFFD8E555] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_sms_channel +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_sms_channel]', RESEED, 6) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_sms_channel +-- ---------------------------- +ALTER TABLE [dbo].[system_sms_channel] ADD CONSTRAINT [PK__system_s__3213E83FA96B966E] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_sms_code +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_sms_code]', RESEED, 470) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_sms_code +-- ---------------------------- +ALTER TABLE [dbo].[system_sms_code] ADD CONSTRAINT [PK__system_s__3213E83F825CBCB9] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_sms_log +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_sms_log]', RESEED, 6) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_sms_log +-- ---------------------------- +ALTER TABLE [dbo].[system_sms_log] ADD CONSTRAINT [PK__system_s__3213E83F5F1968A9] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_sms_template +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_sms_template]', RESEED, 13) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_sms_template +-- ---------------------------- +ALTER TABLE [dbo].[system_sms_template] ADD CONSTRAINT [PK__system_s__3213E83F5C91CA37] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_social_user +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_social_user]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_social_user +-- ---------------------------- +ALTER TABLE [dbo].[system_social_user] ADD CONSTRAINT [PK__system_s__3213E83F6EF3863C] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_social_user_bind +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_social_user_bind]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_social_user_bind +-- ---------------------------- +ALTER TABLE [dbo].[system_social_user_bind] ADD CONSTRAINT [PK__system_s__3213E83F21F44049] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_tenant +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_tenant]', RESEED, 122) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_tenant +-- ---------------------------- +ALTER TABLE [dbo].[system_tenant] ADD CONSTRAINT [PK__system_t__3213E83FAF444092] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_tenant_package +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_tenant_package]', RESEED, 111) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_tenant_package +-- ---------------------------- +ALTER TABLE [dbo].[system_tenant_package] ADD CONSTRAINT [PK__system_t__3213E83FA2213DB5] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_user_post +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_user_post]', RESEED, 115) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_user_post +-- ---------------------------- +ALTER TABLE [dbo].[system_user_post] ADD CONSTRAINT [PK__system_u__3213E83F56DD4107] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_user_role +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_user_role]', RESEED, 17) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_user_role +-- ---------------------------- +ALTER TABLE [dbo].[system_user_role] ADD CONSTRAINT [PK__system_u__3213E83F3593F652] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for system_users +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[system_users]', RESEED, 115) +GO + + +-- ---------------------------- +-- Primary Key structure for table system_users +-- ---------------------------- +ALTER TABLE [dbo].[system_users] ADD CONSTRAINT [PK__system_u__3213E83F7CF2516E] PRIMARY KEY CLUSTERED ([id]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Foreign Keys structure for table QRTZ_BLOB_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_BLOB_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_BLOB_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION +GO + + +-- ---------------------------- +-- Foreign Keys structure for table QRTZ_CRON_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION +GO + + +-- ---------------------------- +-- Foreign Keys structure for table QRTZ_SIMPLE_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION +GO + + +-- ---------------------------- +-- Foreign Keys structure for table QRTZ_SIMPROP_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION +GO + + +-- ---------------------------- +-- Foreign Keys structure for table QRTZ_TRIGGERS +-- ---------------------------- +ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY ([SCHED_NAME], [JOB_NAME], [JOB_GROUP]) REFERENCES [dbo].[QRTZ_JOB_DETAILS] ([SCHED_NAME], [JOB_NAME], [JOB_GROUP]) ON DELETE NO ACTION ON UPDATE NO ACTION +GO + diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 0f304ca5a..65972964b 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -16,31 +16,31 @@ 1.6.2-snapshot - 2.5.12 + 2.6.8 - 3.0.2 - 1.5.22 + 3.0.3 + 1.6.6 2.5 1.2.8 - 3.4.3.4 + 3.5.2 3.5.2 3.5.0 - 3.17.0 + 3.17.3 1.9.2 2.2.0 - 1.7.0 + 1.7.1 8.7.0 - 2.6.2 + 2.6.7 0.31.0 7.2.6.RELEASE 0.1.16 - 3.9.0 + 4.0.0 7.1.0.M6 6.7.0 @@ -52,6 +52,7 @@ 2.2.7 2.2 1.0.5 + 2.0.5 30.1.1-jre 5.1.0 2.12.2 @@ -78,6 +79,11 @@ + + cn.iocoder.boot + yudao-spring-boot-starter-banner + ${revision} + cn.iocoder.boot yudao-spring-boot-starter-biz-operatelog @@ -118,6 +124,11 @@ yudao-spring-boot-starter-biz-social ${revision} + + cn.iocoder.boot + yudao-spring-boot-starter-biz-error-code + ${revision} + @@ -475,6 +486,12 @@ ${velocity.version} + + com.alibaba + fastjson + ${fastjson.version} + + cn.smallbun.screw screw-core @@ -483,6 +500,10 @@ org.freemarker freemarker + + + com.alibaba + fastjson diff --git a/yudao-framework/pom.xml b/yudao-framework/pom.xml index 35880d110..ed8f6719f 100644 --- a/yudao-framework/pom.xml +++ b/yudao-framework/pom.xml @@ -11,6 +11,7 @@ pom yudao-common + yudao-spring-boot-starter-banner yudao-spring-boot-starter-mybatis yudao-spring-boot-starter-redis yudao-spring-boot-starter-web @@ -29,11 +30,15 @@ yudao-spring-boot-starter-biz-operatelog yudao-spring-boot-starter-biz-dict yudao-spring-boot-starter-biz-sms + yudao-spring-boot-starter-biz-pay yudao-spring-boot-starter-biz-weixin yudao-spring-boot-starter-biz-social yudao-spring-boot-starter-biz-tenant yudao-spring-boot-starter-biz-data-permission + yudao-spring-boot-starter-biz-error-code + + yudao-spring-boot-starter-activiti yudao-spring-boot-starter-flowable diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java index 68e0ead10..cd1b9dc5e 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java @@ -1,8 +1,11 @@ package cn.iocoder.yudao.framework.common.enums; +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.Arrays; + /** * 通用状态枚举 * @@ -10,11 +13,14 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum CommonStatusEnum { +public enum CommonStatusEnum implements IntArrayValuable { ENABLE(0, "开启"), DISABLE(1, "关闭"); + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray(); + + /** * 状态值 */ @@ -24,4 +30,9 @@ public enum CommonStatusEnum { */ private final String name; + @Override + public int[] array() { + return ARRAYS; + } + } diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java index 2e4d9ab95..54d4be9d9 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.common.enums; /** * Web 过滤器顺序的枚举类,保证过滤器按照符合我们的预期 * - * 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 util 包下 + * 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 enums 包下 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServerException.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServerException.java new file mode 100644 index 000000000..fac56d5e2 --- /dev/null +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServerException.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.framework.common.exception; + +import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 服务器异常 Exception + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class ServerException extends RuntimeException { + + /** + * 全局错误码 + * + * @see GlobalErrorCodeConstants + */ + private Integer code; + /** + * 错误提示 + */ + private String message; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServerException() { + } + + public ServerException(ErrorCode errorCode) { + this.code = errorCode.getCode(); + this.message = errorCode.getMsg(); + } + + public ServerException(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public ServerException setCode(Integer code) { + this.code = code; + return this; + } + + @Override + public String getMessage() { + return message; + } + + public ServerException setMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java index 69b97e5ae..a132e63d7 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java @@ -36,9 +36,15 @@ public interface GlobalErrorCodeConstants { ErrorCode UNKNOWN = new ErrorCode(999, "未知错误"); - static boolean isMatch(Integer code) { + /** + * 是否为服务端错误,参考 HTTP 5XX 错误码段 + * + * @param code 错误码 + * @return 是否 + */ + static boolean isServerErrorCode(Integer code) { return code != null - && code >= SUCCESS.getCode() && code <= UNKNOWN.getCode(); + && code >= INTERNAL_SERVER_ERROR.getCode() && code <= INTERNAL_SERVER_ERROR.getCode() + 99; } } diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java index 0b66179ad..e3cfc453f 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java @@ -29,6 +29,10 @@ package cn.iocoder.yudao.framework.common.exception.enums; */ public class ServiceErrorCodeRange { - // 模块 system 错误码区间 [1-000-001-000 ~ 1-000-002-000] + // 模块 infra 错误码区间 [1-001-000-000 ~ 1-002-000-000) + // 模块 system 错误码区间 [1-002-000-000 ~ 1-003-000-000) + // 模块 member 错误码区间 [1-004-000-000 ~ 1-005-000-000) + // 模块 pay 错误码区间 [1-007-000-000 ~ 1-008-000-000) + // 模块 bpm 错误码区间 [1-009-000-000 ~ 1-010-000-000) } diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java index eb6124b8b..cb82d301a 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.framework.common.pojo; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.common.exception.ServerException; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -91,10 +92,24 @@ public class CommonResult implements Serializable { if (isSuccess()) { return; } + // 服务端异常 + if (GlobalErrorCodeConstants.isServerErrorCode(code)) { + throw new ServerException(code, msg); + } // 业务异常 throw new ServiceException(code, msg); } + /** + * 判断是否有异常。如果有,则抛出 {@link ServiceException} 异常 + * 如果没有,则返回 {@link #data} 数据 + */ + @JsonIgnore // 避免 jackson 序列化 + public T getCheckedData() { + checkError(); + return data; + } + public static CommonResult error(ServiceException serviceException) { return error(serviceException.getCode(), serviceException.getMessage()); } diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java index 6a4c28e72..80029703b 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java @@ -23,8 +23,8 @@ public class PageParam implements Serializable { @ApiModelProperty(value = "每页条数,最大值为 100", required = true, example = "10") @NotNull(message = "每页条数不能为空") - @Min(value = 1, message = "页码最小值为 1") - @Max(value = 100, message = "页码最大值为 100") + @Min(value = 1, message = "每页条数最小值为 1") + @Max(value = 100, message = "每页条数最大值为 100") private Integer pageSize = PAGE_SIZE; } diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java new file mode 100644 index 000000000..7f7318487 --- /dev/null +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.framework.common.util.cache; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; + +import java.time.Duration; +import java.util.concurrent.Executors; + +/** + * Cache 工具类 + * + * @author 芋道源码 + */ +public class CacheUtils { + + public static LoadingCache buildAsyncReloadingCache(Duration duration, CacheLoader loader) { + return CacheBuilder.newBuilder() + // 只阻塞当前数据加载线程,其他线程返回旧值 + .refreshAfterWrite(duration) + // 通过 asyncReloading 实现全异步加载,包括 refreshAfterWrite 被阻塞的加载线程 + .build(CacheLoader.asyncReloading(loader, Executors.newCachedThreadPool())); // TODO 芋艿:可能要思考下,未来要不要做成可配置 + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-banner/pom.xml b/yudao-framework/yudao-spring-boot-starter-banner/pom.xml new file mode 100644 index 000000000..e740fce5f --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-banner/pom.xml @@ -0,0 +1,30 @@ + + + + yudao-framework + cn.iocoder.boot + ${revision} + + 4.0.0 + yudao-spring-boot-starter-banner + jar + + ${project.artifactId} + Banner 用于在 console 控制台,打印开发文档、接口文档等 + https://github.com/YunaiV/ruoyi-vue-pro + + + + cn.iocoder.boot + yudao-common + + + + org.springframework.boot + spring-boot-starter + + + + diff --git a/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java new file mode 100644 index 000000000..2ae83f3f8 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.framework.banner.config; + +import cn.iocoder.yudao.framework.banner.core.BannerApplicationRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Banner 的自动配置类 + * + * @author 芋道源码 + */ +@Configuration +public class YudaoBannerAutoConfiguration { + + @Bean + public BannerApplicationRunner bannerApplicationRunner() { + return new BannerApplicationRunner(); + } + +} diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java similarity index 87% rename from yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java rename to yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java index db71c5079..27e2f70eb 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java +++ b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java @@ -1,19 +1,19 @@ -package cn.iocoder.yudao.server.framework.tip.core; +package cn.iocoder.yudao.framework.banner.core; import cn.hutool.core.thread.ThreadUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; import java.util.concurrent.TimeUnit; /** * 项目启动成功后,提供文档相关的地址 + * + * @author 芋道源码 */ -@Component @Slf4j -public class TipApplicationRunner implements ApplicationRunner { +public class BannerApplicationRunner implements ApplicationRunner { @Override public void run(ApplicationArguments args) throws Exception { diff --git a/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/package-info.java b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/package-info.java new file mode 100644 index 000000000..aba726853 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/package-info.java @@ -0,0 +1,6 @@ +/** + * Banner 用于在 console 控制台,打印开发文档、接口文档等 + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.framework.banner; diff --git a/yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..416b89477 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.banner.config.YudaoBannerAutoConfiguration diff --git a/yudao-server/src/main/resources/banner.txt b/yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/banner.txt similarity index 100% rename from yudao-server/src/main/resources/banner.txt rename to yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/banner.txt diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java index 609e8a34b..62534ed63 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java @@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration; import java.util.List; /** - * 数据全新啊的自动配置类 + * 数据权限的自动配置类 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java index 36bf5c076..4c1494aca 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java @@ -62,7 +62,7 @@ public class DataPermissionDatabaseInterceptorTest extends BaseMockitoUnitTest { // 调用 interceptor.beforeQuery(null, mappedStatement, null, null, null, boundSql); // 断言 - pluginUtilsMock.verify(never(), () -> PluginUtils.mpBoundSql(boundSql)); + pluginUtilsMock.verify(() -> PluginUtils.mpBoundSql(boundSql), never()); } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml index d2299efff..26e057d28 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml @@ -26,5 +26,18 @@ org.springframework.boot spring-boot-starter + + + + cn.iocoder.boot + yudao-module-system-api + ${revision} + + + + + com.google.guava + guava + diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java index 1828585c0..01f7aba78 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.framework.dict.config; -import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -10,8 +10,8 @@ public class YudaoDictAutoConfiguration { @Bean @SuppressWarnings("InstantiationOfUtilityClass") - public DictFrameworkUtils dictUtils(DictDataFrameworkService service) { - DictFrameworkUtils.init(service); + public DictFrameworkUtils dictUtils(DictDataApi dictDataApi) { + DictFrameworkUtils.init(dictDataApi); return new DictFrameworkUtils(); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java new file mode 100644 index 000000000..7ba720a9d --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位 + */ +package cn.iocoder.yudao.framework.dict.core; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/service/DictDataFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/service/DictDataFrameworkService.java deleted file mode 100644 index 6ff51c33e..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/service/DictDataFrameworkService.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.yudao.framework.dict.core.service; - -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; - -import java.util.List; - -public interface DictDataFrameworkService { - - /** - * 获得指定的字典数据,从缓存中 - * - * @param type 字典类型 - * @param value 字典数据值 - * @return 字典数据 - */ - DictDataRespDTO getDictDataFromCache(String type, String value); - - /** - * 解析获得指定的字典数据,从缓存中 - * - * @param type 字典类型 - * @param label 字典数据标签 - * @return 字典数据 - */ - DictDataRespDTO parseDictDataFromCache(String type, String label); - - /** - * 获得指定类型的字典数据,从缓存中 - * - * @param type 字典类型 - * @return 字典数据列表 - */ - List listDictDatasFromCache(String type); - -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java index 976f81c79..866dcb46d 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java @@ -1,28 +1,70 @@ package cn.iocoder.yudao.framework.dict.core.util; -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; -import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.common.core.KeyValue; +import cn.iocoder.yudao.framework.common.util.cache.CacheUtils; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import java.time.Duration; + /** * 字典工具类 + * + * @author 芋道源码 */ @Slf4j public class DictFrameworkUtils { - private static DictDataFrameworkService service; + private static DictDataApi dictDataApi; - public static void init(DictDataFrameworkService service) { - DictFrameworkUtils.service = service; + private static final DictDataRespDTO DICT_DATA_NULL = new DictDataRespDTO(); + + /** + * 针对 {@link #getDictDataLabel(String, String)} 的缓存 + */ + private static final LoadingCache, DictDataRespDTO> getDictDataCache = CacheUtils.buildAsyncReloadingCache( + Duration.ofMinutes(1L), // 过期时间 1 分钟 + new CacheLoader, DictDataRespDTO>() { + + @Override + public DictDataRespDTO load(KeyValue key) { + return ObjectUtil.defaultIfNull(dictDataApi.getDictData(key.getKey(), key.getValue()), DICT_DATA_NULL); + } + + }); + + /** + * 针对 {@link #parseDictDataValue(String, String)} 的缓存 + */ + private static final LoadingCache, DictDataRespDTO> parseDictDataCache = CacheUtils.buildAsyncReloadingCache( + Duration.ofMinutes(1L), // 过期时间 1 分钟 + new CacheLoader, DictDataRespDTO>() { + + @Override + public DictDataRespDTO load(KeyValue key) { + return ObjectUtil.defaultIfNull(dictDataApi.parseDictData(key.getKey(), key.getValue()), DICT_DATA_NULL); + } + + }); + + public static void init(DictDataApi dictDataApi) { + DictFrameworkUtils.dictDataApi = dictDataApi; log.info("[init][初始化 DictFrameworkUtils 成功]"); } - public static DictDataRespDTO getDictDataFromCache(String type, String value) { - return service.getDictDataFromCache(type, value); + @SneakyThrows + public static String getDictDataLabel(String dictType, String value) { + return getDictDataCache.get(new KeyValue<>(dictType, value)).getLabel(); } - public static DictDataRespDTO parseDictDataFromCache(String type, String label) { - return service.parseDictDataFromCache(type, label); + @SneakyThrows + public static String parseDictDataValue(String dictType, String label) { + return parseDictDataCache.get(new KeyValue<>(dictType, label)).getValue(); } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-error-code/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-error-code/pom.xml new file mode 100644 index 000000000..ff3c32d97 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/pom.xml @@ -0,0 +1,49 @@ + + + + yudao-framework + cn.iocoder.boot + ${revision} + + 4.0.0 + yudao-spring-boot-starter-biz-error-code + jar + + ${project.artifactId} + + 错误码 ErrorCode 的自动配置功能,提供如下功能: + 1. 远程读取:项目启动时,从 system-server 服务,读取数据库中的 ErrorCode 错误码,实现错误码的提水可配置; + 2. 自动更新:管理员在管理后台修数据库中的 ErrorCode 错误码时,项目自动从 system-server 服务加载最新的 ErrorCode 错误码; + 3. 自动写入:项目启动时,将项目本地的错误码写到 system-server 服务中,方便管理员在管理后台编辑; + + https://github.com/YunaiV/ruoyi-vue-pro + + + + cn.iocoder.boot + yudao-common + + + + + org.springframework.boot + spring-boot-starter + + + + + cn.iocoder.boot + yudao-module-system-api + ${revision} + + + + jakarta.validation + jakarta.validation-api + provided + + + + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeProperties.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/ErrorCodeProperties.java similarity index 81% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeProperties.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/ErrorCodeProperties.java index 686f03e2c..1c1d1b8a5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/ErrorCodeProperties.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.config; +package cn.iocoder.yudao.framework.errorcode.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -17,6 +17,10 @@ import java.util.List; @Validated public class ErrorCodeProperties { + /** + * 是否开启 + */ + private Boolean enable = true; /** * 错误码枚举类 */ diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java similarity index 54% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java index 4c72ccec7..e74be61ed 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/config/ErrorCodeConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java @@ -1,37 +1,39 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.config; +package cn.iocoder.yudao.framework.errorcode.config; -import cn.iocoder.yudao.module.system.framework.errorcode.core.generator.ErrorCodeAutoGenerator; -import cn.iocoder.yudao.module.system.framework.errorcode.core.loader.ErrorCodeLoader; -import cn.iocoder.yudao.module.system.framework.errorcode.core.service.ErrorCodeFrameworkService; -import cn.iocoder.yudao.module.system.framework.errorcode.core.loader.ErrorCodeLoaderImpl; -import cn.iocoder.yudao.module.system.framework.errorcode.core.generator.ErrorCodeAutoGeneratorImpl; +import cn.iocoder.yudao.framework.errorcode.core.generator.ErrorCodeAutoGenerator; +import cn.iocoder.yudao.framework.errorcode.core.generator.ErrorCodeAutoGeneratorImpl; +import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoader; +import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoaderImpl; +import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; -// TODO 芋艿:貌似放的位置有问题 /** * 错误码配置类 + * + * @author 芋道源码 */ @Configuration +@ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志 @EnableConfigurationProperties(ErrorCodeProperties.class) @EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码 -public class ErrorCodeConfiguration { +public class YudaoErrorCodeConfiguration { @Bean public ErrorCodeAutoGenerator errorCodeAutoGenerator(@Value("${spring.application.name}") String applicationName, ErrorCodeProperties errorCodeProperties, - ErrorCodeFrameworkService errorCodeFrameworkService) { - return new ErrorCodeAutoGeneratorImpl(applicationName, errorCodeProperties.getConstantsClassList(), - errorCodeFrameworkService); + ErrorCodeApi errorCodeApi) { + return new ErrorCodeAutoGeneratorImpl(applicationName, errorCodeProperties.getConstantsClassList(), errorCodeApi); } @Bean public ErrorCodeLoader errorCodeLoader(@Value("${spring.application.name}") String applicationName, - ErrorCodeFrameworkService errorCodeFrameworkService) { - return new ErrorCodeLoaderImpl(applicationName, errorCodeFrameworkService); + ErrorCodeApi errorCodeApi) { + return new ErrorCodeLoaderImpl(applicationName, errorCodeApi); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java similarity index 71% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java index 6fb2abc02..b13cacaa2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGenerator.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.generator; +package cn.iocoder.yudao.framework.errorcode.core.generator; /** * 错误码的自动生成器 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java similarity index 89% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java index db75aaa7c..a7f6c2835 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java @@ -1,12 +1,12 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.generator; +package cn.iocoder.yudao.framework.errorcode.core.generator; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.util.ClassUtil; import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.common.exception.ErrorCode; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeAutoGenerateReqDTO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.service.ErrorCodeFrameworkService; +import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.event.ApplicationReadyEvent; @@ -36,9 +36,9 @@ public class ErrorCodeAutoGeneratorImpl implements ErrorCodeAutoGenerator { */ private final List constantsClassList; /** - * 错误码 Service + * 错误码 Api */ - private final ErrorCodeFrameworkService errorCodeService; + private final ErrorCodeApi errorCodeApi; @Override @EventListener(ApplicationReadyEvent.class) @@ -49,7 +49,7 @@ public class ErrorCodeAutoGeneratorImpl implements ErrorCodeAutoGenerator { log.info("[execute][解析到错误码数量为 ({}) 个]", autoGenerateDTOs.size()); // 第二步,写入到 system 服务 - errorCodeService.autoGenerateErrorCodes(autoGenerateDTOs); + errorCodeApi.autoGenerateErrorCodes(autoGenerateDTOs); log.info("[execute][写入到 system 组件完成]"); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoader.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoader.java similarity index 87% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoader.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoader.java index 6712c33e9..26fb060d2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoader.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoader.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.loader; +package cn.iocoder.yudao.framework.errorcode.core.loader; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java similarity index 81% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java rename to yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java index 1641f520f..5f327424a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java @@ -1,9 +1,9 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.loader; +package cn.iocoder.yudao.framework.errorcode.core.loader; import cn.hutool.core.collection.CollUtil; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeRespDTO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.service.ErrorCodeFrameworkService; import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.event.ApplicationReadyEvent; @@ -34,9 +34,9 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader { */ private final String applicationName; /** - * 错误码 Service + * 错误码 Api */ - private final ErrorCodeFrameworkService errorCodeService; + private final ErrorCodeApi errorCodeApi; /** * 缓存错误码的最大更新时间,用于后续的增量轮询,判断是否有更新 @@ -55,7 +55,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader { private void loadErrorCodes0() { // 加载错误码 - List errorCodeRespDTOs = errorCodeService.getErrorCodeList(applicationName, maxUpdateTime); + List errorCodeRespDTOs = errorCodeApi.getErrorCodeList(applicationName, maxUpdateTime); if (CollUtil.isEmpty(errorCodeRespDTOs)) { return; } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/package-info.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/package-info.java new file mode 100644 index 000000000..ddba4f78a --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/package-info.java @@ -0,0 +1,10 @@ +/** + * 错误码 ErrorCode 的自动配置功能,提供如下功能: + * + * 1. 远程读取:项目启动时,从 system-service 服务,读取数据库中的 ErrorCode 错误码,实现错误码的提水可配置; + * 2. 自动更新:管理员在管理后台修数据库中的 ErrorCode 错误码时,项目自动从 system-service 服务加载最新的 ErrorCode 错误码; + * 3. 自动写入:项目启动时,将项目本地的错误码写到 system-server 服务中,方便管理员在管理后台编辑; + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.framework.errorcode; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..ab9528c6e --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.errorcode.config.YudaoErrorCodeConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/pom.xml index a35c51365..01deef06f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/pom.xml @@ -34,6 +34,13 @@ provided + + + cn.iocoder.boot + yudao-module-system-api + ${revision} + + com.google.guava diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/config/YudaoOperateLogAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/config/YudaoOperateLogAutoConfiguration.java index c4e784bf0..bd78d2464 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/config/YudaoOperateLogAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/config/YudaoOperateLogAutoConfiguration.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.framework.operatelog.config; import cn.iocoder.yudao.framework.operatelog.core.aop.OperateLogAspect; +import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; +import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkServiceImpl; +import cn.iocoder.yudao.module.system.api.logger.OperateLogApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -12,4 +15,9 @@ public class YudaoOperateLogAutoConfiguration { return new OperateLogAspect(); } + @Bean + public OperateLogFrameworkService operateLogFrameworkService(OperateLogApi operateLogApi) { + return new OperateLogFrameworkServiceImpl(operateLogApi); + } + } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java index ee26efbb2..d3b94d25a 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java @@ -9,9 +9,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; +import cn.iocoder.yudao.framework.operatelog.core.service.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import com.google.common.collect.Maps; @@ -45,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC * 满足如下任一条件,则会进行记录: * 1. 使用 @ApiOperation + 非 @GetMapping * 2. 使用 @OperateLog 注解 - * + *

* 但是,如果声明 @OperateLog 注解时,将 enable 属性设置为 false 时,强制不记录。 * * @author 芋道源码 @@ -57,13 +56,13 @@ public class OperateLogAspect { /** * 用于记录操作内容的上下文 * - * @see OperateLogCreateReqDTO#getContent() + * @see OperateLog#getContent() */ private static final ThreadLocal CONTENT = new ThreadLocal<>(); /** * 用于记录拓展字段的上下文 * - * @see OperateLogCreateReqDTO#getExts() + * @see OperateLog#getExts() */ private static final ThreadLocal> EXTS = new ThreadLocal<>(); @@ -73,16 +72,21 @@ public class OperateLogAspect { @Around("@annotation(apiOperation)") public Object around(ProceedingJoinPoint joinPoint, ApiOperation apiOperation) throws Throwable { // 可能也添加了 @ApiOperation 注解 - OperateLog operateLog = getMethodAnnotation(joinPoint, OperateLog.class); + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog = getMethodAnnotation(joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog.class); return around0(joinPoint, operateLog, apiOperation); } - @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") // 兼容处理,只添加 @OperateLog 注解的情况 - public Object around(ProceedingJoinPoint joinPoint, OperateLog operateLog) throws Throwable { + @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") + // 兼容处理,只添加 @OperateLog 注解的情况 + public Object around(ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { return around0(joinPoint, operateLog, null); } - private Object around0(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation) throws Throwable { + private Object around0(ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, + ApiOperation apiOperation) throws Throwable { // 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录 Integer userType = WebFrameworkUtils.getLoginUserType(); if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) { @@ -121,7 +125,9 @@ public class OperateLogAspect { EXTS.remove(); } - private void log(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation, + private void log(ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, + ApiOperation apiOperation, Date startTime, Object result, Throwable exception) { try { // 判断不记录的情况 @@ -136,113 +142,117 @@ public class OperateLogAspect { } } - private void log0(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation, + private void log0(ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, + ApiOperation apiOperation, Date startTime, Object result, Throwable exception) { - OperateLogCreateReqDTO operateLogDTO = new OperateLogCreateReqDTO(); + OperateLog operateLogObj = new OperateLog(); // 补全通用字段 - operateLogDTO.setTraceId(TracerUtils.getTraceId()); - operateLogDTO.setStartTime(startTime); + operateLogObj.setTraceId(TracerUtils.getTraceId()); + operateLogObj.setStartTime(startTime); // 补充用户信息 - fillUserFields(operateLogDTO); + fillUserFields(operateLogObj); // 补全模块信息 - fillModuleFields(operateLogDTO, joinPoint, operateLog, apiOperation); + fillModuleFields(operateLogObj, joinPoint, operateLog, apiOperation); // 补全请求信息 - fillRequestFields(operateLogDTO); + fillRequestFields(operateLogObj); // 补全方法信息 - fillMethodFields(operateLogDTO, joinPoint, operateLog, startTime, result, exception); + fillMethodFields(operateLogObj, joinPoint, operateLog, startTime, result, exception); // 异步记录日志 - operateLogFrameworkService.createOperateLogAsync(operateLogDTO); + operateLogFrameworkService.createOperateLog(operateLogObj); } - private static void fillUserFields(OperateLogCreateReqDTO operateLogDTO) { - operateLogDTO.setUserId(WebFrameworkUtils.getLoginUserId()); - operateLogDTO.setUserType(WebFrameworkUtils.getLoginUserType()); + private static void fillUserFields(OperateLog operateLogObj) { + operateLogObj.setUserId(WebFrameworkUtils.getLoginUserId()); + operateLogObj.setUserType(WebFrameworkUtils.getLoginUserType()); } - private static void fillModuleFields(OperateLogCreateReqDTO operateLogDTO, - ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation) { + private static void fillModuleFields(OperateLog operateLogObj, + ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, + ApiOperation apiOperation) { // module 属性 if (operateLog != null) { - operateLogDTO.setModule(operateLog.module()); + operateLogObj.setModule(operateLog.module()); } - if (StrUtil.isEmpty(operateLogDTO.getModule())) { + if (StrUtil.isEmpty(operateLogObj.getModule())) { Api api = getClassAnnotation(joinPoint, Api.class); if (api != null) { // 优先读取 @API 的 name 属性 if (StrUtil.isNotEmpty(api.value())) { - operateLogDTO.setModule(api.value()); + operateLogObj.setModule(api.value()); } // 没有的话,读取 @API 的 tags 属性 - if (StrUtil.isEmpty(operateLogDTO.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { - operateLogDTO.setModule(api.tags()[0]); + if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { + operateLogObj.setModule(api.tags()[0]); } } } // name 属性 if (operateLog != null) { - operateLogDTO.setName(operateLog.name()); + operateLogObj.setName(operateLog.name()); } - if (StrUtil.isEmpty(operateLogDTO.getName()) && apiOperation != null) { - operateLogDTO.setName(apiOperation.value()); + if (StrUtil.isEmpty(operateLogObj.getName()) && apiOperation != null) { + operateLogObj.setName(apiOperation.value()); } // type 属性 if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { - operateLogDTO.setType(operateLog.type()[0].getType()); + operateLogObj.setType(operateLog.type()[0].getType()); } - if (operateLogDTO.getType() == null) { + if (operateLogObj.getType() == null) { RequestMethod requestMethod = obtainFirstMatchRequestMethod(obtainRequestMethod(joinPoint)); OperateTypeEnum operateLogType = convertOperateLogType(requestMethod); - operateLogDTO.setType(operateLogType != null ? operateLogType.getType() : null); + operateLogObj.setType(operateLogType != null ? operateLogType.getType() : null); } // content 和 exts 属性 - operateLogDTO.setContent(CONTENT.get()); - operateLogDTO.setExts(EXTS.get()); + operateLogObj.setContent(CONTENT.get()); + operateLogObj.setExts(EXTS.get()); } - private static void fillRequestFields(OperateLogCreateReqDTO operateLogDTO) { + private static void fillRequestFields(OperateLog operateLogObj) { // 获得 Request 对象 HttpServletRequest request = ServletUtils.getRequest(); if (request == null) { return; } // 补全请求信息 - operateLogDTO.setRequestMethod(request.getMethod()); - operateLogDTO.setRequestUrl(request.getRequestURI()); - operateLogDTO.setUserIp(ServletUtil.getClientIP(request)); - operateLogDTO.setUserAgent(ServletUtils.getUserAgent(request)); + operateLogObj.setRequestMethod(request.getMethod()); + operateLogObj.setRequestUrl(request.getRequestURI()); + operateLogObj.setUserIp(ServletUtil.getClientIP(request)); + operateLogObj.setUserAgent(ServletUtils.getUserAgent(request)); } - private static void fillMethodFields(OperateLogCreateReqDTO operateLogDTO, - ProceedingJoinPoint joinPoint, OperateLog operateLog, + private static void fillMethodFields(OperateLog operateLogObj, + ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, Date startTime, Object result, Throwable exception) { MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); - operateLogDTO.setJavaMethod(methodSignature.toString()); + operateLogObj.setJavaMethod(methodSignature.toString()); if (operateLog == null || operateLog.logArgs()) { - operateLogDTO.setJavaMethodArgs(obtainMethodArgs(joinPoint)); + operateLogObj.setJavaMethodArgs(obtainMethodArgs(joinPoint)); } if (operateLog == null || operateLog.logResultData()) { - operateLogDTO.setResultData(obtainResultData(result)); + operateLogObj.setResultData(obtainResultData(result)); } - operateLogDTO.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); + operateLogObj.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); // (正常)处理 resultCode 和 resultMsg 字段 - if (result != null) { - if (result instanceof CommonResult) { - CommonResult commonResult = (CommonResult) result; - operateLogDTO.setResultCode(commonResult.getCode()); - operateLogDTO.setResultMsg(commonResult.getMsg()); - } else { - operateLogDTO.setResultCode(SUCCESS.getCode()); - } + if (result instanceof CommonResult) { + CommonResult commonResult = (CommonResult) result; + operateLogObj.setResultCode(commonResult.getCode()); + operateLogObj.setResultMsg(commonResult.getMsg()); + } else { + operateLogObj.setResultCode(SUCCESS.getCode()); } // (异常)处理 resultCode 和 resultMsg 字段 if (exception != null) { - operateLogDTO.setResultCode(INTERNAL_SERVER_ERROR.getCode()); - operateLogDTO.setResultMsg(ExceptionUtil.getRootCauseMessage(exception)); + operateLogObj.setResultCode(INTERNAL_SERVER_ERROR.getCode()); + operateLogObj.setResultMsg(ExceptionUtil.getRootCauseMessage(exception)); } } - private static boolean isLogEnable(ProceedingJoinPoint joinPoint, OperateLog operateLog) { + private static boolean isLogEnable(ProceedingJoinPoint joinPoint, + cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) { // 有 @OperateLog 注解的情况下 if (operateLog != null) { return operateLog.enable(); @@ -256,7 +266,7 @@ public class OperateLogAspect { return null; } return Arrays.stream(requestMethods).filter(requestMethod -> - requestMethod == RequestMethod.POST + requestMethod == RequestMethod.POST || requestMethod == RequestMethod.PUT || requestMethod == RequestMethod.DELETE) .findFirst().orElse(null); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java deleted file mode 100644 index d676001f2..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java +++ /dev/null @@ -1,87 +0,0 @@ -package cn.iocoder.yudao.framework.operatelog.core.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.Date; -import java.util.Map; - -/** - * 操作日志创建 Request DTO - */ -@Data -public class OperateLogCreateReqDTO { - - @ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") - @NotEmpty(message = "链路追踪编号不能为空") - private String traceId; - - @ApiModelProperty(value = "用户编号", required = true, example = "1024") - @NotNull(message = "用户编号不能为空") - private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "1") - @NotNull(message = "用户类型不能为空") - private Integer userType; - - @ApiModelProperty(value = "操作模块", required = true, example = "订单") - @NotEmpty(message = "操作模块不能为空") - private String module; - - @ApiModelProperty(value = "操作名", required = true, example = "创建订单") - @NotEmpty(message = "操作名") - private String name; - - @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") - @NotNull(message = "操作分类不能为空") - private Integer type; - - @ApiModelProperty(value = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。") - private String content; - - @ApiModelProperty(value = "拓展字段", example = "{'orderId': 1}") - private Map exts; - - @ApiModelProperty(value = "请求方法名", required = true, example = "GET") - @NotEmpty(message = "请求方法名不能为空") - private String requestMethod; - - @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") - @NotEmpty(message = "请求地址不能为空") - private String requestUrl; - - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") - @NotEmpty(message = "用户 IP 不能为空") - private String userIp; - - @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") - @NotEmpty(message = "浏览器 UserAgent 不能为空") - private String userAgent; - - @ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.yudao.UserController.save(...)") - @NotEmpty(message = "Java 方法名不能为空") - private String javaMethod; - - @ApiModelProperty(value = "Java 方法的参数") - private String javaMethodArgs; - - @ApiModelProperty(value = "开始时间", required = true) - @NotNull(message = "开始时间不能为空") - private Date startTime; - - @ApiModelProperty(value = "执行时长,单位:毫秒", required = true) - @NotNull(message = "执行时长不能为空") - private Integer duration; - - @ApiModelProperty(value = "结果码", required = true) - @NotNull(message = "结果码不能为空") - private Integer resultCode; - - @ApiModelProperty(value = "结果提示") - private String resultMsg; - - @ApiModelProperty(value = "结果数据") - private String resultData; - -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLog.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLog.java new file mode 100644 index 000000000..7bce1c6bd --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLog.java @@ -0,0 +1,110 @@ +package cn.iocoder.yudao.framework.operatelog.core.service; + +import lombok.Data; + +import java.util.Date; +import java.util.Map; + +/** + * 操作日志 + * + * @author 芋道源码 + */ +@Data +public class OperateLog { + + /** + * 链路追踪编号 + */ + private String traceId; + + /** + * 用户编号 + */ + private Long userId; + /** + * 用户类型 + */ + private Integer userType; + + /** + * 操作模块 + */ + private String module; + + /** + * 操作名 + */ + private String name; + + /** + * 操作分类 + */ + private Integer type; + + /** + * 操作明细 + */ + private String content; + + /** + * 拓展字段 + */ + private Map exts; + + /** + * 请求方法名 + */ + private String requestMethod; + + /** + * 请求地址 + */ + private String requestUrl; + + /** + * 用户 IP + */ + private String userIp; + + /** + * 浏览器 UserAgent + */ + private String userAgent; + + /** + * Java 方法名 + */ + private String javaMethod; + + /** + * Java 方法的参数 + */ + private String javaMethodArgs; + + /** + * 开始时间 + */ + private Date startTime; + + /** + * 执行时长,单位:毫秒 + */ + private Integer duration; + + /** + * 结果码 + */ + private Integer resultCode; + + /** + * 结果提示 + */ + private String resultMsg; + + /** + * 结果数据 + */ + private String resultData; + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkService.java index ef20e2ece..235616244 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkService.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkService.java @@ -1,17 +1,17 @@ package cn.iocoder.yudao.framework.operatelog.core.service; -import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; - -import java.util.concurrent.Future; - +/** + * 操作日志 Framework Service 接口 + * + * @author 芋道源码 + */ public interface OperateLogFrameworkService { /** - * 异步记录操作日志 + * 记录操作日志 * - * @param reqVO 操作日志请求 - * @return true: 记录成功,false: 记录失败 + * @param operateLog 操作日志请求 */ - Future createOperateLogAsync(OperateLogCreateReqDTO reqVO); + void createOperateLog(OperateLog operateLog); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkServiceImpl.java new file mode 100644 index 000000000..a636c4bdf --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLogFrameworkServiceImpl.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.framework.operatelog.core.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.iocoder.yudao.module.system.api.logger.OperateLogApi; +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Async; + +/** + * 操作日志 Framework Service 实现类 + * + * 基于 {@link OperateLogApi} 实现,记录操作日志 + * + * @author 芋道源码 + */ +@RequiredArgsConstructor +public class OperateLogFrameworkServiceImpl implements OperateLogFrameworkService { + + private final OperateLogApi operateLogApi; + + @Override + @Async + public void createOperateLog(OperateLog operateLog) { + OperateLogCreateReqDTO reqDTO = BeanUtil.copyProperties(operateLog, OperateLogCreateReqDTO.class); + operateLogApi.createOperateLog(reqDTO); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java index ffe40bc3d..aefb3ba3b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig; import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayQrPayClient; import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayWapPayClient; +import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXLitePayClient; import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXNativePayClient; import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig; import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPubPayClient; @@ -62,7 +63,7 @@ public class PayClientFactoryImpl implements PayClientFactory { // TODO @芋艿 WX_LITE WX_APP 如果不添加在 项目启动的时候去初始化会报错无法启动。所以我手动加了两个,具体需要你来配 switch (channelEnum) { case WX_PUB: return (AbstractPayClient) new WXPubPayClient(channelId, (WXPayClientConfig) config); - case WX_LITE: return (AbstractPayClient) new WXPubPayClient(channelId, (WXPayClientConfig) config); + case WX_LITE: return (AbstractPayClient) new WXLitePayClient(channelId, (WXPayClientConfig) config); //微信小程序请求支付 case WX_APP: return (AbstractPayClient) new WXPubPayClient(channelId, (WXPayClientConfig) config); case WX_NATIVE: return (AbstractPayClient) new WXNativePayClient(channelId, (WXPayClientConfig) config); case ALIPAY_WAP: return (AbstractPayClient) new AlipayWapPayClient(channelId, (AlipayPayClientConfig) config); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java index 913e29c50..41c473be7 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; +import cn.hutool.http.HttpUtil; import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping; import cn.iocoder.yudao.framework.pay.core.client.PayCommonResult; import cn.iocoder.yudao.framework.pay.core.client.dto.*; @@ -130,11 +131,20 @@ public abstract class AbstractAlipayClient extends AbstractPayClient strToMap(String s) { + // TODO @zxy:这个可以使用 hutool 的 HttpUtil decodeParams 方法么? Map stringStringMap = new HashMap<>(); - //调整时间格式 + // 调整时间格式 String s3 = s.replaceAll("%3A", ":"); - //获取map + // 获取 map String s4 = s3.replace("+", " "); String[] split = s4.split("&"); for (String s1 : split) { @@ -143,4 +153,5 @@ public abstract class AbstractAlipayClient extends AbstractPayClient { + + private WxPayService client; + + public WXLitePayClient(Long channelId, WXPayClientConfig config) { + super(channelId, PayChannelEnum.WX_LITE.getCode(), config, new WXCodeMapping()); + } + + @Override + protected void doInit() { + WxPayConfig payConfig = new WxPayConfig(); + BeanUtil.copyProperties(config, payConfig, "keyContent"); + payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // 设置使用 JS API 支付方式 +// if (StrUtil.isNotEmpty(config.getKeyContent())) { +// payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8)); +// } + if (StrUtil.isNotEmpty(config.getPrivateKeyContent())) { + // weixin-pay-java 存在 BUG,无法直接设置内容,所以创建临时文件来解决 + payConfig.setPrivateKeyPath(FileUtils.createTempFile(config.getPrivateKeyContent()).getPath()); + } + if (StrUtil.isNotEmpty(config.getPrivateCertContent())) { + // weixin-pay-java 存在 BUG,无法直接设置内容,所以创建临时文件来解决 + payConfig.setPrivateCertPath(FileUtils.createTempFile(config.getPrivateCertContent()).getPath()); + } + // 真实客户端 + this.client = new WxPayServiceImpl(); + client.setConfig(payConfig); + } + + @Override + public PayCommonResult doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) { + WxPayMpOrderResult response; + try { + switch (config.getApiVersion()) { + case WXPayClientConfig.API_VERSION_V2: + response = this.unifiedOrderV2(reqDTO); + break; + case WXPayClientConfig.API_VERSION_V3: + WxPayUnifiedOrderV3Result.JsapiResult responseV3 = this.unifiedOrderV3(reqDTO); + // 将 V3 的结果,统一转换成 V2。返回的字段是一致的 + response = new WxPayMpOrderResult(); + BeanUtil.copyProperties(responseV3, response, true); + break; + default: + throw new IllegalArgumentException(String.format("未知的 API 版本(%s)", config.getApiVersion())); + } + } catch (WxPayException e) { + log.error("[unifiedOrder][request({}) 发起支付失败,原因({})]", toJsonString(reqDTO), e); + return PayCommonResult.build(ObjectUtils.defaultIfNull(e.getErrCode(), e.getReturnCode(), "CustomErrorCode"), + ObjectUtils.defaultIfNull(e.getErrCodeDes(), e.getCustomErrorMsg()), null, codeMapping); + } + return PayCommonResult.build(CODE_SUCCESS, MESSAGE_SUCCESS, response, codeMapping); + } + + private WxPayMpOrderResult unifiedOrderV2(PayOrderUnifiedReqDTO reqDTO) throws WxPayException { + // 构建 WxPayUnifiedOrderRequest 对象 + WxPayUnifiedOrderRequest request = WxPayUnifiedOrderRequest.newBuilder() + .outTradeNo(reqDTO.getMerchantOrderId()) + .body(reqDTO.getBody()) + .totalFee(reqDTO.getAmount().intValue()) // 单位分 + .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")) // v2的时间格式 + .spbillCreateIp(reqDTO.getUserIp()) + .openid(getOpenid(reqDTO)) + .notifyUrl(reqDTO.getNotifyUrl()) + .build(); + // 执行请求 + return client.createOrder(request); + } + + private WxPayUnifiedOrderV3Result.JsapiResult unifiedOrderV3(PayOrderUnifiedReqDTO reqDTO) throws WxPayException { + // 构建 WxPayUnifiedOrderRequest 对象 + WxPayUnifiedOrderV3Request request = new WxPayUnifiedOrderV3Request(); + request.setOutTradeNo(reqDTO.getMerchantOrderId()); + + request.setDescription(reqDTO.getBody()); + request.setAmount(new WxPayUnifiedOrderV3Request + .Amount() + .setTotal(reqDTO + .getAmount() + .intValue())); // 单位分 + request.setTimeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")); // v3的时间格式 + request.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(getOpenid(reqDTO))); + request.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(reqDTO.getUserIp())); + request.setNotifyUrl(reqDTO.getNotifyUrl()); + // 执行请求 + return client.createOrderV3(TradeTypeEnum.JSAPI, request); + } + + private static String getOpenid(PayOrderUnifiedReqDTO reqDTO) { + String openid = MapUtil.getStr(reqDTO.getChannelExtras(), "openid"); + if (StrUtil.isEmpty(openid)) { + throw new IllegalArgumentException("支付请求的 openid 不能为空!"); + } + return openid; + } + + /** + * + * 微信支付回调 分 v2 和v3 的处理方式 + * + * @param data 通知结果 + * @return 支付回调对象 + * @throws WxPayException 微信异常类 + */ + @Override + public PayOrderNotifyRespDTO parseOrderNotify(PayNotifyDataDTO data) throws WxPayException { + log.info("[parseOrderNotify][微信支付回调data数据:{}]", data.getBody()); + // 微信支付 v2 回调结果处理 + switch (config.getApiVersion()) { + case WXPayClientConfig.API_VERSION_V2: + return parseOrderNotifyV2(data); + case WXPayClientConfig.API_VERSION_V3: + return parseOrderNotifyV3(data); + default: + throw new IllegalArgumentException(String.format("未知的 API 版本(%s)", config.getApiVersion())); + } + } + + private PayOrderNotifyRespDTO parseOrderNotifyV3(PayNotifyDataDTO data) throws WxPayException { + WxPayOrderNotifyV3Result wxPayOrderNotifyV3Result = client.parseOrderNotifyV3Result(data.getBody(), null); + WxPayOrderNotifyV3Result.DecryptNotifyResult result = wxPayOrderNotifyV3Result.getResult(); + // 转换结果 + Assert.isTrue(Objects.equals(wxPayOrderNotifyV3Result.getResult().getTradeState(), "SUCCESS"), + "支付结果非 SUCCESS"); + + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(result.getOutTradeNo()) + .channelOrderNo(result.getTradeState()) + .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) + .data(data.getBody()) + .build(); + } + + private PayOrderNotifyRespDTO parseOrderNotifyV2(PayNotifyDataDTO data) throws WxPayException { + WxPayOrderNotifyResult notifyResult = client.parseOrderNotifyResult(data.getBody()); + Assert.isTrue(Objects.equals(notifyResult.getResultCode(), "SUCCESS"), "支付结果非 SUCCESS"); + // 转换结果 + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(notifyResult.getOutTradeNo()) + .channelOrderNo(notifyResult.getTransactionId()) + .channelUserId(notifyResult.getOpenid()) + .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) + .data(data.getBody()) + .build(); + + } + + @Override + public PayRefundNotifyDTO parseRefundNotify(PayNotifyDataDTO notifyData) { + //TODO 需要实现 + throw new UnsupportedOperationException("需要实现"); + } + + + @Override + protected PayCommonResult doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) throws Throwable { + //TODO 需要实现 + throw new UnsupportedOperationException(); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java index f0074c044..20ad91c82 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.*; import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result; import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request; @@ -28,9 +29,14 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.CODE_SUCCESS; import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.MESSAGE_SUCCESS; - +/** + * 微信 App 支付 + * + * @author zwy + */ @Slf4j public class WXNativePayClient extends AbstractPayClient { + private WxPayService client; public WXNativePayClient(Long channelId, WXPayClientConfig config) { @@ -61,7 +67,7 @@ public class WXNativePayClient extends AbstractPayClient { @Override public PayCommonResult doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) { // 这里原生的返回的是支付的 url 所以直接使用string接收 - //"invokeResponse": "weixin://wxpay/bizpayurl?pr=EGYAem7zz" + // "invokeResponse": "weixin://wxpay/bizpayurl?pr=EGYAem7zz" String responseV3; try { switch (config.getApiVersion()) { @@ -84,7 +90,7 @@ public class WXNativePayClient extends AbstractPayClient { private WxPayNativeOrderResult unifiedOrderV2(PayOrderUnifiedReqDTO reqDTO) throws WxPayException { //前端 - String trade_type = reqDTO.getChannelExtras().get("trade_type"); + String tradeType = reqDTO.getChannelExtras().get("trade_type"); // 构建 WxPayUnifiedOrderRequest 对象 WxPayUnifiedOrderRequest request = WxPayUnifiedOrderRequest .newBuilder() @@ -94,7 +100,7 @@ public class WXNativePayClient extends AbstractPayClient { .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) .spbillCreateIp(reqDTO.getUserIp()) .notifyUrl(reqDTO.getNotifyUrl()) - .productId(trade_type) + .productId(tradeType) .build(); // 执行请求 return client.createOrder(request); @@ -109,33 +115,72 @@ public class WXNativePayClient extends AbstractPayClient { request.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(reqDTO.getUserIp())); request.setNotifyUrl(reqDTO.getNotifyUrl()); // 执行请求 -// log.info("支付字段request:{}",request.getTimeExpire()); - return client.createOrderV3(TradeTypeEnum.NATIVE, request); } - + /** + * + * 微信支付回调 分v2 和v3 的处理方式 + * + * @param data 通知结果 + * @return 支付回调对象 + * @throws WxPayException 微信异常类 + */ @Override public PayOrderNotifyRespDTO parseOrderNotify(PayNotifyDataDTO data) throws WxPayException { + log.info("微信支付回调data数据:{}", data.getBody()); + // 微信支付 v2 回调结果处理 + switch (config.getApiVersion()) { + case WXPayClientConfig.API_VERSION_V2: + return parseOrderNotifyV2(data); + case WXPayClientConfig.API_VERSION_V3: + return parseOrderNotifyV3(data); + default: + throw new IllegalArgumentException(String.format("未知的 API 版本(%s)", config.getApiVersion())); + } + } + + private PayOrderNotifyRespDTO parseOrderNotifyV3(PayNotifyDataDTO data) throws WxPayException { + WxPayOrderNotifyV3Result wxPayOrderNotifyV3Result = client.parseOrderNotifyV3Result(data.getBody(), null); + WxPayOrderNotifyV3Result.DecryptNotifyResult result = wxPayOrderNotifyV3Result.getResult(); + // 转换结果 + Assert.isTrue(Objects.equals(wxPayOrderNotifyV3Result.getResult().getTradeState(), "SUCCESS"), + "支付结果非 SUCCESS"); + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(result.getOutTradeNo()) + .channelOrderNo(result.getTradeState()) + .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) + .data(data.getBody()) + .build(); + } + + private PayOrderNotifyRespDTO parseOrderNotifyV2(PayNotifyDataDTO data) throws WxPayException { WxPayOrderNotifyResult notifyResult = client.parseOrderNotifyResult(data.getBody()); Assert.isTrue(Objects.equals(notifyResult.getResultCode(), "SUCCESS"), "支付结果非 SUCCESS"); // 转换结果 - return PayOrderNotifyRespDTO.builder().orderExtensionNo(notifyResult.getOutTradeNo()) - .channelOrderNo(notifyResult.getTransactionId()).channelUserId(notifyResult.getOpenid()) - .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyy-MM-dd'T'HH:mm:ssXXX")) - .data(data.getBody()).build(); + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(notifyResult.getOutTradeNo()) + .channelOrderNo(notifyResult.getTransactionId()) + .channelUserId(notifyResult.getOpenid()) + .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) + .data(data.getBody()) + .build(); + } @Override public PayRefundNotifyDTO parseRefundNotify(PayNotifyDataDTO notifyData) { - //TODO 需要实现 + // TODO 需要实现 throw new UnsupportedOperationException("需要实现"); } @Override protected PayCommonResult doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) throws Throwable { - //TODO 需要实现 + // TODO 需要实现 throw new UnsupportedOperationException(); } + } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPayClientConfig.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPayClientConfig.java index 507243c0b..294f8e4ff 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPayClientConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPayClientConfig.java @@ -11,8 +11,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Set; -// TODO 芋艿:参数校验 - /** * 微信支付的 PayClientConfig 实现类 * 属性主要来自 {@link com.github.binarywang.wxpay.config.WxPayConfig} 的必要属性 @@ -22,7 +20,6 @@ import java.util.Set; @Data public class WXPayClientConfig implements PayClientConfig { - // TODO 芋艿:V2 or V3 客户端 /** * API 版本 - V2 * https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_1 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java index 866405e79..238344759 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java @@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.*; import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request; @@ -95,7 +96,6 @@ public class WXPubPayClient extends AbstractPayClient { // 构建 WxPayUnifiedOrderRequest 对象 WxPayUnifiedOrderRequest request = WxPayUnifiedOrderRequest.newBuilder() .outTradeNo(reqDTO.getMerchantOrderId()) - // TODO 芋艿:貌似没 title? .body(reqDTO.getBody()) .totalFee(reqDTO.getAmount().intValue()) // 单位分 .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) @@ -111,7 +111,6 @@ public class WXPubPayClient extends AbstractPayClient { // 构建 WxPayUnifiedOrderRequest 对象 WxPayUnifiedOrderV3Request request = new WxPayUnifiedOrderV3Request(); request.setOutTradeNo(reqDTO.getMerchantOrderId()); - // TODO 芋艿:貌似没 title? request.setDescription(reqDTO.getBody()); request.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(reqDTO.getAmount().intValue())); // 单位分 request.setTimeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")); @@ -130,27 +129,67 @@ public class WXPubPayClient extends AbstractPayClient { return openid; } + /** + * + * 微信支付回调 分v2 和v3 的处理方式 + * + * @param data 通知结果 + * @return 支付回调对象 + * @throws WxPayException 微信异常类 + */ @Override public PayOrderNotifyRespDTO parseOrderNotify(PayNotifyDataDTO data) throws WxPayException { + log.info("[parseOrderNotify][微信支付回调data数据: {}]", data.getBody()); + // 微信支付 v2 回调结果处理 + switch (config.getApiVersion()) { + case WXPayClientConfig.API_VERSION_V2: + return parseOrderNotifyV2(data); + case WXPayClientConfig.API_VERSION_V3: + return parseOrderNotifyV3(data); + default: + throw new IllegalArgumentException(String.format("未知的 API 版本(%s)", config.getApiVersion())); + } + } + + private PayOrderNotifyRespDTO parseOrderNotifyV3(PayNotifyDataDTO data) throws WxPayException { + WxPayOrderNotifyV3Result wxPayOrderNotifyV3Result = client.parseOrderNotifyV3Result(data.getBody(), null); + WxPayOrderNotifyV3Result.DecryptNotifyResult result = wxPayOrderNotifyV3Result.getResult(); + // 转换结果 + Assert.isTrue(Objects.equals(wxPayOrderNotifyV3Result.getResult().getTradeState(), "SUCCESS"), + "支付结果非 SUCCESS"); + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(result.getOutTradeNo()) + .channelOrderNo(result.getTradeState()) + .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) + .data(data.getBody()) + .build(); + } + + private PayOrderNotifyRespDTO parseOrderNotifyV2(PayNotifyDataDTO data) throws WxPayException { WxPayOrderNotifyResult notifyResult = client.parseOrderNotifyResult(data.getBody()); Assert.isTrue(Objects.equals(notifyResult.getResultCode(), "SUCCESS"), "支付结果非 SUCCESS"); // 转换结果 - return PayOrderNotifyRespDTO.builder().orderExtensionNo(notifyResult.getOutTradeNo()) - .channelOrderNo(notifyResult.getTransactionId()).channelUserId(notifyResult.getOpenid()) + return PayOrderNotifyRespDTO + .builder() + .orderExtensionNo(notifyResult.getOutTradeNo()) + .channelOrderNo(notifyResult.getTransactionId()) + .channelUserId(notifyResult.getOpenid()) .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) - .data(data.getBody()).build(); + .data(data.getBody()) + .build(); + } @Override public PayRefundNotifyDTO parseRefundNotify(PayNotifyDataDTO notifyData) { - //TODO 需要实现 + // TODO 需要实现 throw new UnsupportedOperationException("需要实现"); } - @Override protected PayCommonResult doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) throws Throwable { - //TODO 需要实现 + // TODO 需要实现 throw new UnsupportedOperationException(); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/PayChannelEnum.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/PayChannelEnum.java index a708faf8e..0754f9dae 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/PayChannelEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/PayChannelEnum.java @@ -22,7 +22,6 @@ public enum PayChannelEnum { WX_APP("wx_app", "微信 App 支付", WXPayClientConfig.class), WX_NATIVE("wx_native", "微信 native 支付", WXPayClientConfig.class), - ALIPAY_PC("alipay_pc", "支付宝 PC 网站支付", AlipayPayClientConfig.class), ALIPAY_WAP("alipay_wap", "支付宝 Wap 网站支付", AlipayPayClientConfig.class), ALIPAY_APP("alipay_app", "支付宝App 支付", AlipayPayClientConfig.class), diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java index fcae86c5e..078159724 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.framework.social.config; -import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; import com.xkcoding.http.HttpUtil; import com.xkcoding.http.support.hutool.HutoolImpl; @@ -11,6 +10,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; /** * 社交自动装配类 @@ -24,6 +24,7 @@ import org.springframework.context.annotation.Configuration; public class YudaoSocialAutoConfiguration { @Bean + @Primary @ConditionalOnProperty(prefix = "justauth", value = "enabled", havingValue = "true", matchIfMissing = true) public YudaoAuthRequestFactory yudaoAuthRequestFactory(JustAuthProperties properties, AuthStateCache authStateCache) { // 需要修改 HttpUtil 使用的实现,避免类报错 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java index 8f3cf5d51..b2cd28ec6 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.social.core; import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; -import cn.iocoder.yudao.framework.social.core.request.AuthWeChatMiniProgramRequest; +import cn.iocoder.yudao.framework.social.core.request.AuthWeChatMiniAppRequest; import com.xkcoding.justauth.AuthRequestFactory; import com.xkcoding.justauth.autoconfigure.JustAuthProperties; import me.zhyd.oauth.cache.AuthStateCache; @@ -20,7 +20,6 @@ import java.lang.reflect.Method; * @author timfruit * @date 2021-10-31 */ -// TODO @timfruit:单测 public class YudaoAuthRequestFactory extends AuthRequestFactory { protected JustAuthProperties properties; @@ -69,15 +68,14 @@ public class YudaoAuthRequestFactory extends AuthRequestFactory { if (config == null) { return null; } - // 配置 http config - ReflectUtil.invoke(this, configureHttpConfigMethod, - authExtendSource.name(), config, properties.getHttpConfig()); + // 反射调用,配置 http config + ReflectUtil.invoke(this, configureHttpConfigMethod, authExtendSource.name(), config, properties.getHttpConfig()); // 获得拓展的 Request // noinspection SwitchStatementWithTooFewBranches switch (authExtendSource) { - case WECHAT_MINI_PROGRAM: - return new AuthWeChatMiniProgramRequest(config, authStateCache); + case WECHAT_MINI_APP: + return new AuthWeChatMiniAppRequest(config, authStateCache); default: return null; } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java index ce61bca40..f51c81e02 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.social.core.enums; import me.zhyd.oauth.config.AuthSource; /** - * 拓展JustAuth各api需要的url, 用枚举类分平台类型管理 + * 拓展 JustAuth 各 api 需要的 url, 用枚举类分平台类型管理 * * 默认配置 {@link me.zhyd.oauth.config.AuthDefaultSource} * @@ -14,25 +14,25 @@ public enum AuthExtendSource implements AuthSource { /** * 微信小程序授权登录 */ - WECHAT_MINI_PROGRAM { + WECHAT_MINI_APP { @Override public String authorize() { - // https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html - throw new UnsupportedOperationException("不支持获取授权url, 请使用小程序内置函数wx.login()登录获取code"); + // 参见 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html 文档 + throw new UnsupportedOperationException("不支持获取授权 url,请使用小程序内置函数 wx.login() 登录获取 code"); } @Override public String accessToken() { - // https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html - // 获取openid, unionid , session_key + // 参见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html 文档 + // 获取 openid, unionId , session_key 等字段 return "https://api.weixin.qq.com/sns/jscode2session"; } @Override public String userInfo() { - //https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html - throw new UnsupportedOperationException("不支持获取用户信息url, 请使用小程序内置函数wx.getUserProfile()获取用户信息"); + // 参见 https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html 文档 + throw new UnsupportedOperationException("不支持获取用户信息 url,请使用小程序内置函数 wx.getUserProfile() 获取用户信息"); } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/model/AuthExtendToken.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/model/AuthExtendToken.java deleted file mode 100644 index 2c0f4f403..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/model/AuthExtendToken.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.yudao.framework.social.core.model; - -import lombok.*; -import me.zhyd.oauth.model.AuthToken; - -/** - * 授权所需的 token 拓展类 - * - * @author timfruit - * @date 2021-10-29 - */ -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -public class AuthExtendToken extends AuthToken { - - /** - * 微信小程序 - 会话密钥 - */ - private String miniSessionKey; - -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniProgramRequest.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java similarity index 50% rename from yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniProgramRequest.java rename to yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java index e5bbfcaad..5ff5b8578 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniProgramRequest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java @@ -1,100 +1,97 @@ -package cn.iocoder.yudao.framework.social.core.request; - -import cn.iocoder.yudao.framework.common.util.json.JsonUtils; -import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; -import cn.iocoder.yudao.framework.social.core.model.AuthExtendToken; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import me.zhyd.oauth.cache.AuthStateCache; -import me.zhyd.oauth.config.AuthConfig; -import me.zhyd.oauth.exception.AuthException; -import me.zhyd.oauth.model.AuthCallback; -import me.zhyd.oauth.model.AuthToken; -import me.zhyd.oauth.model.AuthUser; -import me.zhyd.oauth.request.AuthDefaultRequest; -import me.zhyd.oauth.utils.HttpUtils; -import me.zhyd.oauth.utils.UrlBuilder; - -/** - * 微信小程序登陆 - * - * @author timfruit - * @date 2021-10-29 - */ -public class AuthWeChatMiniProgramRequest extends AuthDefaultRequest { - - public AuthWeChatMiniProgramRequest(AuthConfig config) { - super(config, AuthExtendSource.WECHAT_MINI_PROGRAM); - } - - public AuthWeChatMiniProgramRequest(AuthConfig config, AuthStateCache authStateCache) { - super(config, AuthExtendSource.WECHAT_MINI_PROGRAM, authStateCache); - } - - @Override - protected AuthToken getAccessToken(AuthCallback authCallback) { - // https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html - String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())); - CodeSessionResponse accessTokenObject = JsonUtils.parseObject(response, CodeSessionResponse.class); - - this.checkResponse(accessTokenObject); - - AuthExtendToken token = new AuthExtendToken(); - token.setMiniSessionKey(accessTokenObject.sessionKey); - token.setOpenId(accessTokenObject.openid); - token.setUnionId(accessTokenObject.unionid); - return token; - } - - @Override - protected AuthUser getUserInfo(AuthToken authToken) { - // https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html - // 如果需要用户信息,需要在小程序调用函数后传给后端 - return AuthUser.builder() - .uuid(authToken.getOpenId()) - //TODO 是使用默认值,还是有小程序获取用户信息 和 code 一起传过来 - .nickname("") - .avatar("") - .token(authToken) - .source(source.toString()) - .build(); - } - - /** - * 检查响应内容是否正确 - * - * @param object 请求响应内容 - */ - private void checkResponse(CodeSessionResponse object) { - if (object.errcode != 0) { - throw new AuthException(object.errcode, object.errmsg); - } - } - - /** - * 返回获取 accessToken 的 url - * - * @param code 授权码 - * @return 返回获取 accessToken 的 url - */ - @Override - protected String accessTokenUrl(String code) { - return UrlBuilder.fromBaseUrl(source.accessToken()) - .queryParam("appid", config.getClientId()) - .queryParam("secret", config.getClientSecret()) - .queryParam("js_code", code) - .queryParam("grant_type", "authorization_code") - .build(); - } - - @Data - private static class CodeSessionResponse { - private int errcode; - private String errmsg; - @JsonProperty("session_key") - private String sessionKey; - private String openid; - private String unionid; - } - -} +package cn.iocoder.yudao.framework.social.core.request; + +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; +import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +/** + * 微信小程序登陆 Request 请求 + * + * 由于 JustAuth 定位是面向 Web 为主的三方登录,所以微信小程序只能自己封装 + * + * @author timfruit + * @date 2021-10-29 + */ +public class AuthWeChatMiniAppRequest extends AuthDefaultRequest { + + public AuthWeChatMiniAppRequest(AuthConfig config, AuthStateCache authStateCache) { + super(config, AuthExtendSource.WECHAT_MINI_APP, authStateCache); + } + + @Override + protected AuthToken getAccessToken(AuthCallback authCallback) { + // 参见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html 文档 + // 使用 code 获取对应的 openId、unionId 等字段 + String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())); + JSCode2SessionResponse accessTokenObject = JsonUtils.parseObject(response, JSCode2SessionResponse.class); + assert accessTokenObject != null; + checkResponse(accessTokenObject); + // 拼装结果 + return AuthToken.builder() + .openId(accessTokenObject.getOpenid()) + .unionId(accessTokenObject.getUnionId()) + .build(); + } + + @Override + protected AuthUser getUserInfo(AuthToken authToken) { + // 参见 https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html 文档 + // 如果需要用户信息,需要在小程序调用函数后传给后端 + return AuthUser.builder() + .username("") + .nickname("") + .avatar("") + .uuid(authToken.getOpenId()) + .token(authToken) + .source(source.toString()) + .build(); + } + + /** + * 检查响应内容是否正确 + * + * @param response 请求响应内容 + */ + private void checkResponse(JSCode2SessionResponse response) { + if (response.getErrorCode() != 0) { + throw new AuthException(response.getErrorCode(), response.getErrorMsg()); + } + } + + @Override + protected String accessTokenUrl(String code) { + return UrlBuilder.fromBaseUrl(source.accessToken()) + .queryParam("appid", config.getClientId()) + .queryParam("secret", config.getClientSecret()) + .queryParam("js_code", code) // 和父类不同,所以需要重写该方法 + .queryParam("grant_type", "authorization_code") + .build(); + } + + @Data + @SuppressWarnings("SpellCheckingInspection") + private static class JSCode2SessionResponse { + + @JsonProperty("errcode") + private int errorCode; + @JsonProperty("errmsg") + private String errorMsg; + @JsonProperty("session_key") + private String sessionKey; + private String openid; + @JsonProperty("unionid") + private String unionId; + + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-tenant/pom.xml index 1d67e7a9c..1d43ff2c5 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/pom.xml @@ -56,6 +56,12 @@ spring-boot-starter-test test + + + + com.google.guava + guava + diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java index 5c1376534..c1c969439 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java @@ -11,9 +11,11 @@ import cn.iocoder.yudao.framework.tenant.core.job.TenantJobHandlerDecorator; import cn.iocoder.yudao.framework.tenant.core.mq.TenantRedisMessageInterceptor; import cn.iocoder.yudao.framework.tenant.core.security.TenantSecurityWebFilter; import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; +import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkServiceImpl; import cn.iocoder.yudao.framework.tenant.core.web.TenantContextWebFilter; import cn.iocoder.yudao.framework.web.config.WebProperties; import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; +import cn.iocoder.yudao.module.system.api.tenant.TenantApi; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; import org.springframework.beans.BeansException; @@ -29,6 +31,11 @@ import org.springframework.context.annotation.Configuration; @EnableConfigurationProperties(TenantProperties.class) public class YudaoTenantAutoConfiguration { + @Bean + public TenantFrameworkService tenantFrameworkService(TenantApi tenantApi) { + return new TenantFrameworkServiceImpl(tenantApi); + } + // ========== AOP ========== @Bean diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/TenantRedisMessageInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/TenantRedisMessageInterceptor.java index 15c72f992..c493b41d1 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/TenantRedisMessageInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/TenantRedisMessageInterceptor.java @@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.mq.core.interceptor.RedisMessageInterceptor; import cn.iocoder.yudao.framework.mq.core.message.AbstractRedisMessage; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; +import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; + /** * 多租户 {@link AbstractRedisMessage} 拦截器 * @@ -15,8 +17,6 @@ import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; */ public class TenantRedisMessageInterceptor implements RedisMessageInterceptor { - private static final String HEADER_TENANT_ID = "tenant-id"; - @Override public void sendMessageBefore(AbstractRedisMessage message) { Long tenantId = TenantContextHolder.getTenantId(); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java new file mode 100644 index 000000000..75d065e1e --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java @@ -0,0 +1,73 @@ +package cn.iocoder.yudao.framework.tenant.core.service; + +import cn.iocoder.yudao.framework.common.exception.ServiceException; +import cn.iocoder.yudao.framework.common.util.cache.CacheUtils; +import cn.iocoder.yudao.module.system.api.tenant.TenantApi; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; + +import java.time.Duration; +import java.util.List; + +/** + * Tenant 框架 Service 实现类 + * + * @author 芋道源码 + */ +@RequiredArgsConstructor +public class TenantFrameworkServiceImpl implements TenantFrameworkService { + + private static final ServiceException SERVICE_EXCEPTION_NULL = new ServiceException(); + + private final TenantApi tenantApi; + + /** + * 针对 {@link #getTenantIds()} 的缓存 + */ + private final LoadingCache> getTenantIdsCache = CacheUtils.buildAsyncReloadingCache( + Duration.ofMinutes(1L), // 过期时间 1 分钟 + new CacheLoader>() { + + @Override + public List load(Object key) { + return tenantApi.getTenantIds(); + } + + }); + + /** + * 针对 {@link #validTenant(Long)} 的缓存 + */ + private final LoadingCache validTenantCache = CacheUtils.buildAsyncReloadingCache( + Duration.ofMinutes(1L), // 过期时间 1 分钟 + new CacheLoader() { + + @Override + public ServiceException load(Long id) { + try { + tenantApi.validTenant(id); + return SERVICE_EXCEPTION_NULL; + } catch (ServiceException ex) { + return ex; + } + } + + }); + + @Override + @SneakyThrows + public List getTenantIds() { + return getTenantIdsCache.get(Boolean.TRUE); + } + + @Override + public void validTenant(Long id) { + ServiceException serviceException = validTenantCache.getUnchecked(id); + if (serviceException != SERVICE_EXCEPTION_NULL) { + throw serviceException; + } + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/web/TenantContextWebFilter.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/web/TenantContextWebFilter.java index 272419c09..8e37727d9 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/web/TenantContextWebFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/web/TenantContextWebFilter.java @@ -18,8 +18,6 @@ import java.io.IOException; */ public class TenantContextWebFilter extends OncePerRequestFilter { - private static final String HEADER_TENANT_ID = "tenant-id"; - @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml index 763c722c4..4c53e2900 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml @@ -33,9 +33,13 @@ com.github.binarywang - wx-java-mp-spring-boot-starter - 4.1.9.B + 4.3.4.B + + + com.github.binarywang + wx-java-miniapp-spring-boot-starter + 4.3.4.B diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java index beed26f94..7698cf4a6 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.framework.excel.core.convert; import cn.hutool.core.convert.Convert; -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; import com.alibaba.excel.converters.Converter; @@ -12,7 +11,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; import lombok.extern.slf4j.Slf4j; /** - * Excel {@link DictDataRespDTO} 数据字典转换器 + * Excel 数据字典转换器 * * @author 芋道源码 */ @@ -35,14 +34,14 @@ public class DictConvert implements Converter { // 使用字典解析 String type = getType(contentProperty); String label = cellData.getStringValue(); - DictDataRespDTO dictData = DictFrameworkUtils.parseDictDataFromCache(type, label); - if (dictData == null) { + String value = DictFrameworkUtils.parseDictDataValue(type, label); + if (value == null) { log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); return null; } // 将 String 的 value 转换成对应的属性 Class fieldClazz = contentProperty.getField().getType(); - return Convert.convert(fieldClazz, dictData.getValue()); + return Convert.convert(fieldClazz, value); } @Override @@ -56,13 +55,13 @@ public class DictConvert implements Converter { // 使用字典格式化 String type = getType(contentProperty); String value = String.valueOf(object); - DictDataRespDTO dictData = DictFrameworkUtils.getDictDataFromCache(type, value); - if (dictData == null) { + String label = DictFrameworkUtils.getDictDataLabel(type, value); + if (label == null) { log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); return new CellData<>(""); } // 生成 Excel 小表格 - return new CellData<>(dictData.getLabel()); + return new CellData<>(label); } private static String getType(ExcelContentProperty contentProperty) { diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml b/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml index 5c728353c..ebd1210c0 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml @@ -58,6 +58,12 @@ apm-toolkit-opentracing + + + io.micrometer + micrometer-registry-prometheus + + de.codecentric spring-boot-admin-starter-client diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java new file mode 100644 index 000000000..cda0d2cb8 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.framework.tracer.config; + +import io.micrometer.core.instrument.MeterRegistry; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Metrics 配置类 + * + * @author 芋道源码 + */ +@Configuration +@ConditionalOnClass({MeterRegistryCustomizer.class}) +@ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics +public class YudaoMetricsAutoConfiguration { + + @Bean + public MeterRegistryCustomizer metricsCommonTags( + @Value("${spring.application.name}") String applicationName) { + return registry -> registry.config().commonTags("application", applicationName); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories index 6f4f606bb..9b69f01ea 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories @@ -1,2 +1,3 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - cn.iocoder.yudao.framework.tracer.config.YudaoTracerAutoConfiguration + cn.iocoder.yudao.framework.tracer.config.YudaoTracerAutoConfiguration,\ + cn.iocoder.yudao.framework.tracer.config.YudaoMetricsAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-security/pom.xml b/yudao-framework/yudao-spring-boot-starter-security/pom.xml index 4e32a6c7c..864f1f101 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-security/pom.xml @@ -44,6 +44,12 @@ spring-boot-starter-security + + + com.google.guava + guava + + cn.iocoder.boot diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java index a9373cd9c..7454b5ff6 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java @@ -6,6 +6,8 @@ import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; +import java.util.Collections; +import java.util.List; @ConfigurationProperties(prefix = "yudao.security") @Validated @@ -16,18 +18,23 @@ public class SecurityProperties { * HTTP 请求时,访问令牌的请求 Header */ @NotEmpty(message = "Token Header 不能为空") - private String tokenHeader; + private String tokenHeader = "Authorization"; /** * mock 模式的开关 */ @NotNull(message = "mock 模式的开关不能为空") - private Boolean mockEnable; + private Boolean mockEnable = false; /** * mock 模式的密钥 * 一定要配置密钥,保证安全性 */ @NotEmpty(message = "mock 模式的密钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。 - private String mockSecret = "yudaoyuanma"; + private String mockSecret = "test"; + + /** + * 免登录的 URL 列表 + */ + private List permitAllUrls = Collections.emptyList(); } diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java index c5f2ef033..e9045c76f 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java @@ -8,7 +8,7 @@ import cn.iocoder.yudao.framework.security.core.handler.AuthenticationEntryPoint import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkService; import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkServiceImpl; import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; -import cn.iocoder.yudao.module.system.api.auth.OAuth2TokenApi; +import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; import cn.iocoder.yudao.module.system.api.permission.PermissionApi; import org.springframework.beans.factory.config.MethodInvokingFactoryBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -81,7 +81,7 @@ public class YudaoSecurityAutoConfiguration { return new TokenAuthenticationFilter(securityProperties, globalExceptionHandler, oauth2TokenApi); } - @Bean("ss") // 使用 Spring Security 的缩写,方便食用 + @Bean("ss") // 使用 Spring Security 的缩写,方便使用 public SecurityFrameworkService securityFrameworkService(PermissionApi permissionApi) { return new SecurityFrameworkServiceImpl(permissionApi); } diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 61edba6e8..b938d8287 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -2,7 +2,10 @@ package cn.iocoder.yudao.framework.security.config; import cn.iocoder.yudao.framework.security.core.filter.TokenAuthenticationFilter; import cn.iocoder.yudao.framework.web.config.WebProperties; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; @@ -14,9 +17,15 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import java.util.List; +import java.util.Map; +import java.util.Set; /** * 自定义的 Spring Security 配置适配器实现 @@ -29,6 +38,8 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap @Resource private WebProperties webProperties; + @Resource + private SecurityProperties securityProperties; /** * 认证失败处理类 Bean @@ -54,6 +65,9 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap @Resource private List authorizeRequestsCustomizers; + @Resource + private ApplicationContext applicationContext; + /** * 由于 Spring Security 创建 AuthenticationManager 对象时,没声明 @Bean 注解,导致无法被注入 * 通过覆写父类的该方法,添加 @Bean 注解,解决该问题 @@ -98,13 +112,21 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap .accessDeniedHandler(accessDeniedHandler); // 登录、登录暂时不使用 Spring Security 的拓展点,主要考虑一方面拓展多用户、多种登录方式相对复杂,一方面用户的学习成本较高 + // 获得 @PermitAll 带来的 URL 列表,免登录 + Multimap permitAllUrls = getPermitAllUrlsFromAnnotations(); // 设置每个请求的权限 httpSecurity // ①:全局共享规则 .authorizeRequests() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll() - .antMatchers(HttpMethod.GET, "/admin-ui/**").permitAll() + // 设置 @PermitAll 无需认证 + .antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll() + .antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll() + .antMatchers(HttpMethod.PUT, permitAllUrls.get(HttpMethod.PUT).toArray(new String[0])).permitAll() + .antMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll() + // 基于 yudao.security.permit-all-urls 无需认证 + .antMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll() // 设置 App API 无需认证 .antMatchers(buildAppApi("/**")).permitAll() // ②:每个项目的自定义规则 @@ -118,9 +140,46 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap // 添加 JWT Filter httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); } - + private String buildAppApi(String url) { return webProperties.getAppApi().getPrefix() + url; } + private Multimap getPermitAllUrlsFromAnnotations() { + Multimap result = HashMultimap.create(); + // 获得接口对应的 HandlerMethod 集合 + RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) + applicationContext.getBean("requestMappingHandlerMapping"); + Map handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods(); + // 获得有 @PermitAll 注解的接口 + for (Map.Entry entry : handlerMethodMap.entrySet()) { + HandlerMethod handlerMethod = entry.getValue(); + if (!handlerMethod.hasMethodAnnotation(PermitAll.class)) { + continue; + } + if (entry.getKey().getPatternsCondition() == null) { + continue; + } + Set urls = entry.getKey().getPatternsCondition().getPatterns(); + // 根据请求方法,添加到 result 结果 + entry.getKey().getMethodsCondition().getMethods().forEach(requestMethod -> { + switch (requestMethod) { + case GET: + result.putAll(HttpMethod.GET, urls); + break; + case POST: + result.putAll(HttpMethod.POST, urls); + break; + case PUT: + result.putAll(HttpMethod.PUT, urls); + break; + case DELETE: + result.putAll(HttpMethod.DELETE, urls); + break; + } + }); + } + return result; + } + } diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java index e59324004..e87f5bc44 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java @@ -10,8 +10,8 @@ import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; -import cn.iocoder.yudao.module.system.api.auth.OAuth2TokenApi; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCheckRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO; import lombok.RequiredArgsConstructor; import org.springframework.security.access.AccessDeniedException; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java index aa2f18c76..d2703a0e7 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java @@ -2,13 +2,16 @@ package cn.iocoder.yudao.framework.test.core.util; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.util.collection.SetUtils; import uk.co.jemos.podam.api.PodamFactory; import uk.co.jemos.podam.api.PodamFactoryImpl; import java.lang.reflect.Type; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -22,7 +25,6 @@ public class RandomUtils { private static final int RANDOM_STRING_LENGTH = 10; - private static final Set TINYINT_FIELDS = SetUtils.asSet("type", "category"); private static final int TINYINT_MAX = 127; private static final int RANDOM_DATE_MAX = 30; @@ -41,9 +43,10 @@ public class RandomUtils { if (attributeMetadata.getAttributeName().equals("status")) { return RandomUtil.randomEle(CommonStatusEnum.values()).getStatus(); } - // 针对部分字段,使用 tinyint 范围 - if (TINYINT_FIELDS.contains(attributeMetadata.getAttributeName())) { - return RandomUtil.randomInt(1, TINYINT_MAX + 1); + // 如果是 type、status 结尾的字段,返回 tinyint 范围 + if (StrUtil.endWithAnyIgnoreCase(attributeMetadata.getAttributeName(), + "type", "status", "category", "scope")) { + return RandomUtil.randomInt(0, TINYINT_MAX + 1); } return RandomUtil.randomInt(); }); diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index 44081d86b..8662584e3 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -53,6 +53,13 @@ provided + + + cn.iocoder.boot + yudao-module-infra-api + ${revision} + + io.github.resilience4j diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java index 7dc78c445..e2875c1c3 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java @@ -2,11 +2,17 @@ package cn.iocoder.yudao.framework.apilog.config; import cn.iocoder.yudao.framework.apilog.core.filter.ApiAccessLogFilter; import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; +import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkServiceImpl; +import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; +import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkServiceImpl; +import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; import cn.iocoder.yudao.framework.web.config.WebProperties; import cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration; -import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; +import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi; +import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -17,10 +23,21 @@ import javax.servlet.Filter; @AutoConfigureAfter(YudaoWebAutoConfiguration.class) public class YudaoApiLogAutoConfiguration { + @Bean + public ApiAccessLogFrameworkService apiAccessLogFrameworkService(ApiAccessLogApi apiAccessLogApi) { + return new ApiAccessLogFrameworkServiceImpl(apiAccessLogApi); + } + + @Bean + public ApiErrorLogFrameworkService apiErrorLogFrameworkService(ApiErrorLogApi apiErrorLogApi) { + return new ApiErrorLogFrameworkServiceImpl(apiErrorLogApi); + } + /** * 创建 ApiAccessLogFilter Bean,记录 API 请求日志 */ @Bean + @ConditionalOnProperty(prefix = "yudao.access-log", value = "enable", matchIfMissing = true) // 允许使用 yudao.access-log.enable=false 禁用访问日志 public FilterRegistrationBean apiAccessLogFilter(WebProperties webProperties, @Value("${spring.application.name}") String applicationName, ApiAccessLogFrameworkService apiAccessLogFrameworkService) { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java index a0bdf64c8..6417189b0 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java @@ -3,8 +3,8 @@ package cn.iocoder.yudao.framework.apilog.core.filter; import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.extra.servlet.ServletUtil; +import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLog; import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.date.DateUtils; @@ -66,16 +66,16 @@ public class ApiAccessLogFilter extends ApiRequestFilter { private void createApiAccessLog(HttpServletRequest request, Date beginTime, Map queryString, String requestBody, Exception ex) { - ApiAccessLogCreateReqDTO accessLog = new ApiAccessLogCreateReqDTO(); + ApiAccessLog accessLog = new ApiAccessLog(); try { this.buildApiAccessLogDTO(accessLog, request, beginTime, queryString, requestBody, ex); - apiAccessLogFrameworkService.createApiAccessLogAsync(accessLog); + apiAccessLogFrameworkService.createApiAccessLog(accessLog); } catch (Throwable th) { log.error("[createApiAccessLog][url({}) log({}) 发生异常]", request.getRequestURI(), toJsonString(accessLog), th); } } - private void buildApiAccessLogDTO(ApiAccessLogCreateReqDTO accessLog, HttpServletRequest request, Date beginTime, + private void buildApiAccessLogDTO(ApiAccessLog accessLog, HttpServletRequest request, Date beginTime, Map queryString, String requestBody, Exception ex) { // 处理用户信息 accessLog.setUserId(WebFrameworkUtils.getLoginUserId(request)); diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLog.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLog.java new file mode 100644 index 000000000..a92b06c26 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLog.java @@ -0,0 +1,85 @@ +package cn.iocoder.yudao.framework.apilog.core.service; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * API 访问日志 + * + * @author 芋道源码 + */ +@Data +public class ApiAccessLog { + + /** + * 链路追踪编号 + */ + private String traceId; + /** + * 用户编号 + */ + private Long userId; + /** + * 用户类型 + */ + private Integer userType; + /** + * 应用名 + */ + @NotNull(message = "应用名不能为空") + private String applicationName; + + /** + * 请求方法名 + */ + @NotNull(message = "http 请求方法不能为空") + private String requestMethod; + /** + * 访问地址 + */ + @NotNull(message = "访问地址不能为空") + private String requestUrl; + /** + * 请求参数 + */ + @NotNull(message = "请求参数不能为空") + private String requestParams; + /** + * 用户 IP + */ + @NotNull(message = "ip 不能为空") + private String userIp; + /** + * 浏览器 UA + */ + @NotNull(message = "User-Agent 不能为空") + private String userAgent; + + /** + * 开始请求时间 + */ + @NotNull(message = "开始请求时间不能为空") + private Date beginTime; + /** + * 结束请求时间 + */ + @NotNull(message = "结束请求时间不能为空") + private Date endTime; + /** + * 执行时长,单位:毫秒 + */ + @NotNull(message = "执行时长不能为空") + private Integer duration; + /** + * 结果码 + */ + @NotNull(message = "错误码不能为空") + private Integer resultCode; + /** + * 结果提示 + */ + private String resultMsg; + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkService.java index 71df0f6fb..9bfc3a573 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkService.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkService.java @@ -1,9 +1,5 @@ package cn.iocoder.yudao.framework.apilog.core.service; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO; - -import javax.validation.Valid; - /** * API 访问日志 Framework Service 接口 * @@ -14,8 +10,8 @@ public interface ApiAccessLogFrameworkService { /** * 创建 API 访问日志 * - * @param createDTO 创建信息 + * @param apiAccessLog API 访问日志 */ - void createApiAccessLogAsync(@Valid ApiAccessLogCreateReqDTO createDTO); + void createApiAccessLog(ApiAccessLog apiAccessLog); } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java new file mode 100644 index 000000000..83162f164 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.framework.apilog.core.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Async; + +/** + * API 访问日志 Framework Service 实现类 + * + * 基于 {@link ApiAccessLogApi} 服务,记录访问日志 + * + * @author 芋道源码 + */ +@RequiredArgsConstructor +public class ApiAccessLogFrameworkServiceImpl implements ApiAccessLogFrameworkService { + + private final ApiAccessLogApi apiAccessLogApi; + + @Override + @Async + public void createApiAccessLog(ApiAccessLog apiAccessLog) { + ApiAccessLogCreateReqDTO reqDTO = BeanUtil.copyProperties(apiAccessLog, ApiAccessLogCreateReqDTO.class); + apiAccessLogApi.createApiAccessLog(reqDTO); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLog.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLog.java new file mode 100644 index 000000000..3f5d539cb --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLog.java @@ -0,0 +1,107 @@ +package cn.iocoder.yudao.framework.apilog.core.service; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * API 错误日志 + * + * @author 芋道源码 + */ +@Data +public class ApiErrorLog { + + /** + * 链路编号 + */ + private String traceId; + /** + * 账号编号 + */ + private Long userId; + /** + * 用户类型 + */ + private Integer userType; + /** + * 应用名 + */ + @NotNull(message = "应用名不能为空") + private String applicationName; + + /** + * 请求方法名 + */ + @NotNull(message = "http 请求方法不能为空") + private String requestMethod; + /** + * 访问地址 + */ + @NotNull(message = "访问地址不能为空") + private String requestUrl; + /** + * 请求参数 + */ + @NotNull(message = "请求参数不能为空") + private String requestParams; + /** + * 用户 IP + */ + @NotNull(message = "ip 不能为空") + private String userIp; + /** + * 浏览器 UA + */ + @NotNull(message = "User-Agent 不能为空") + private String userAgent; + + /** + * 异常时间 + */ + @NotNull(message = "异常时间不能为空") + private Date exceptionTime; + /** + * 异常名 + */ + @NotNull(message = "异常名不能为空") + private String exceptionName; + /** + * 异常发生的类全名 + */ + @NotNull(message = "异常发生的类全名不能为空") + private String exceptionClassName; + /** + * 异常发生的类文件 + */ + @NotNull(message = "异常发生的类文件不能为空") + private String exceptionFileName; + /** + * 异常发生的方法名 + */ + @NotNull(message = "异常发生的方法名不能为空") + private String exceptionMethodName; + /** + * 异常发生的方法所在行 + */ + @NotNull(message = "异常发生的方法所在行不能为空") + private Integer exceptionLineNumber; + /** + * 异常的栈轨迹异常的栈轨迹 + */ + @NotNull(message = "异常的栈轨迹不能为空") + private String exceptionStackTrace; + /** + * 异常导致的根消息 + */ + @NotNull(message = "异常导致的根消息不能为空") + private String exceptionRootCauseMessage; + /** + * 异常导致的消息 + */ + @NotNull(message = "异常导致的消息不能为空") + private String exceptionMessage; + + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkService.java index 9229745d7..403c574bc 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkService.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkService.java @@ -1,9 +1,5 @@ package cn.iocoder.yudao.framework.apilog.core.service; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; - -import javax.validation.Valid; - /** * API 错误日志 Framework Service 接口 * @@ -14,8 +10,8 @@ public interface ApiErrorLogFrameworkService { /** * 创建 API 错误日志 * - * @param createDTO 创建信息 + * @param apiErrorLog API 错误日志 */ - void createApiErrorLogAsync(@Valid ApiErrorLogCreateReqDTO createDTO); + void createApiErrorLog(ApiErrorLog apiErrorLog); } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java new file mode 100644 index 000000000..cb5abe3c2 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.framework.apilog.core.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Async; + +/** + * API 错误日志 Framework Service 实现类 + * + * 基于 {@link ApiErrorLogApi} 服务,记录错误日志 + * + * @author 芋道源码 + */ +@RequiredArgsConstructor +public class ApiErrorLogFrameworkServiceImpl implements ApiErrorLogFrameworkService { + + private final ApiErrorLogApi apiErrorLogApi; + + @Override + @Async + public void createApiErrorLog(ApiErrorLog apiErrorLog) { + ApiErrorLogCreateReqDTO reqDTO = BeanUtil.copyProperties(apiErrorLog, ApiErrorLogCreateReqDTO.class); + apiErrorLogApi.createApiErrorLog(reqDTO); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index f8d0761e6..b4b29974c 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.framework.swagger.config; +import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor; import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -21,6 +21,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Collections; import java.util.List; +import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; import static springfox.documentation.builders.RequestHandlerSelectors.basePackage; /** @@ -38,28 +39,27 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka public class YudaoSwaggerAutoConfiguration { @Bean - @ConditionalOnMissingBean - public SwaggerProperties swaggerProperties() { - return new SwaggerProperties(); + public SpringFoxHandlerProviderBeanPostProcessor springFoxHandlerProviderBeanPostProcessor() { + return new SpringFoxHandlerProviderBeanPostProcessor(); } @Bean - public Docket createRestApi() { - SwaggerProperties properties = swaggerProperties(); + public Docket createRestApi(SwaggerProperties properties) { // 创建 Docket 对象 return new Docket(DocumentationType.SWAGGER_2) - // 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息) + // ① 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息) .apiInfo(apiInfo(properties)) - // 设置扫描指定 package 包下的 + // ② 设置扫描指定 package 包下的 .select() .apis(basePackage(properties.getBasePackage())) -// .apis(basePackage("cn.iocoder.yudao.module.infra")) // 可用于 swagger 无法展示时使用 +// .apis(basePackage("cn.iocoder.yudao.module.system")) // 可用于 swagger 无法展示时使用 .paths(PathSelectors.any()) .build() + // ③ 安全上下文(认证) .securitySchemes(securitySchemes()) - .globalRequestParameters(globalRequestParameters()) .securityContexts(securityContexts()) - .host("http://localhost:48080"); + // ④ 全局参数(多租户 header) + .globalRequestParameters(globalRequestParameters()); } // ========== apiInfo ========== @@ -94,6 +94,7 @@ public class YudaoSwaggerAutoConfiguration { private static List securityContexts() { return Collections.singletonList(SecurityContext.builder() .securityReferences(securityReferences()) + // 通过 PathSelectors.regex("^(?!auth).*$"),排除包含 "auth" 的接口不需要使用securitySchemes .forPaths(PathSelectors.regex("^(?!auth).*$")) .build()); } @@ -109,7 +110,8 @@ public class YudaoSwaggerAutoConfiguration { // ========== globalRequestParameters ========== private static List globalRequestParameters() { - RequestParameterBuilder tenantParameter = new RequestParameterBuilder().name("tenant-id").description("租户编号") + RequestParameterBuilder tenantParameter = new RequestParameterBuilder() + .name(HEADER_TENANT_ID).description("租户编号") .in(ParameterType.HEADER).example(new ExampleBuilder().value(1L).build()); return Collections.singletonList(tenantParameter.build()); } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java new file mode 100644 index 000000000..c9d178ac8 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.framework.swagger.core; + +import cn.hutool.core.util.ReflectUtil; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; +import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider; +import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; + +import java.util.List; + +/** + * 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题 + * 该问题对应的 issue 为 https://github.com/springfox/springfox/issues/3462 + * + * @author 芋道源码 + */ +public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor { + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) { + customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); + } + return bean; + } + + private void customizeSpringfoxHandlerMappings(List mappings) { + // 移除,只保留 patternParser + List copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null); + // 添加到 mappings 中 + mappings.clear(); + mappings.addAll(copy); + } + + @SuppressWarnings("unchecked") + private List getHandlerMappings(Object bean) { + return (List) + ReflectUtil.getFieldValue(bean, "handlerMappings"); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java index 173a67042..03f4d70b6 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.framework.web.config; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; @@ -15,14 +17,16 @@ import javax.validation.constraints.NotNull; public class WebProperties { @NotNull(message = "APP API 不能为空") - private Api appApi; + private Api appApi = new Api("/app-api", "**.controller.app.**"); @NotNull(message = "Admin API 不能为空") - private Api adminApi; + private Api adminApi = new Api("/admin-api", "**.controller.admin.**"); @NotNull(message = "Admin UI 不能为空") private Ui adminUi; @Data + @AllArgsConstructor + @NoArgsConstructor @Valid public static class Api { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index 578ad76f9..7a0fe6be7 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -3,14 +3,14 @@ package cn.iocoder.yudao.framework.web.core.handler; import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.extra.servlet.ServletUtil; +import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLog; +import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; -import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; -import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; +import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; +import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import io.github.resilience4j.ratelimiter.RequestNotPermitted; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -229,18 +229,18 @@ public class GlobalExceptionHandler { private void createExceptionLog(HttpServletRequest req, Throwable e) { // 插入错误日志 - ApiErrorLogCreateReqDTO errorLog = new ApiErrorLogCreateReqDTO(); + ApiErrorLog errorLog = new ApiErrorLog(); try { // 初始化 errorLog initExceptionLog(errorLog, req, e); // 执行插入 errorLog - apiErrorLogFrameworkService.createApiErrorLogAsync(errorLog); + apiErrorLogFrameworkService.createApiErrorLog(errorLog); } catch (Throwable th) { log.error("[createExceptionLog][url({}) log({}) 发生异常]", req.getRequestURI(), JsonUtils.toJsonString(errorLog), th); } } - private void initExceptionLog(ApiErrorLogCreateReqDTO errorLog, HttpServletRequest request, Throwable e) { + private void initExceptionLog(ApiErrorLog errorLog, HttpServletRequest request, Throwable e) { // 处理用户信息 errorLog.setUserId(WebFrameworkUtils.getLoginUserId(request)); errorLog.setUserType(WebFrameworkUtils.getLoginUserType(request)); diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java index f5ac676fa..e11a3236a 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java @@ -23,7 +23,7 @@ public class WebFrameworkUtils { private static final String REQUEST_ATTRIBUTE_COMMON_RESULT = "common_result"; - private static final String HEADER_TENANT_ID = "tenant-id"; + public static final String HEADER_TENANT_ID = "tenant-id"; private static WebProperties properties; diff --git a/yudao-module-infra/yudao-module-infra-api/pom.xml b/yudao-module-infra/yudao-module-infra-api/pom.xml index f194e82b0..168ea645b 100644 --- a/yudao-module-infra/yudao-module-infra-api/pom.xml +++ b/yudao-module-infra/yudao-module-infra-api/pom.xml @@ -21,6 +21,13 @@ cn.iocoder.boot yudao-common + + + + org.springframework.boot + spring-boot-starter-validation + true + diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java index fa3ec5c6e..c41c6e039 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java @@ -1,7 +1,5 @@ package cn.iocoder.yudao.module.infra.api.file; -import cn.hutool.core.util.IdUtil; - /** * 文件 API 接口 * @@ -15,9 +13,9 @@ public interface FileApi { * @param content 文件内容 * @return 文件路径 */ - default String createFile(byte[] content) throws Exception { - return createFile(IdUtil.fastUUID(), content); - } + default String createFile(byte[] content) { + return createFile(null, null, content); + } /** * 保存文件,并返回文件的访问路径 @@ -26,6 +24,18 @@ public interface FileApi { * @param content 文件内容 * @return 文件路径 */ - String createFile(String path, byte[] content) throws Exception; + default String createFile(String path, byte[] content) { + return createFile(null, path, content); + } + + /** + * 保存文件,并返回文件的访问路径 + * + * @param name 文件名称 + * @param path 文件路径 + * @param content 文件内容 + * @return 文件路径 + */ + String createFile(String name, String path, byte[] content); } diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java new file mode 100644 index 000000000..ed3f3ee1e --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.infra.api.logger; + +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; + +import javax.validation.Valid; + +/** + * API 访问日志的 API 接口 + * + * @author 芋道源码 + */ +public interface ApiAccessLogApi { + + /** + * 创建 API 访问日志 + * + * @param createDTO 创建信息 + */ + void createApiAccessLog(@Valid ApiAccessLogCreateReqDTO createDTO); + +} diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java new file mode 100644 index 000000000..9b53c6643 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.infra.api.logger; + +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; + +import javax.validation.Valid; + +/** + * API 错误日志的 API 接口 + * + * @author 芋道源码 + */ +public interface ApiErrorLogApi { + + /** + * 创建 API 错误日志 + * + * @param createDTO 创建信息 + */ + void createApiErrorLog(@Valid ApiErrorLogCreateReqDTO createDTO); + +} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiAccessLogCreateReqDTO.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiAccessLogCreateReqDTO.java rename to yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java index a32f7b346..0ad0ea79c 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiAccessLogCreateReqDTO.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.apilog.core.service.dto; +package cn.iocoder.yudao.module.infra.api.logger.dto; import lombok.Data; @@ -6,7 +6,7 @@ import javax.validation.constraints.NotNull; import java.util.Date; /** - * API 访问日志创建 DTO + * API 访问日志 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiErrorLogCreateReqDTO.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java similarity index 93% rename from yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiErrorLogCreateReqDTO.java rename to yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java index 70baebc5c..c2d555703 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/dto/ApiErrorLogCreateReqDTO.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java @@ -1,18 +1,16 @@ -package cn.iocoder.yudao.framework.apilog.core.service.dto; +package cn.iocoder.yudao.module.infra.api.logger.dto; import lombok.Data; -import lombok.experimental.Accessors; import javax.validation.constraints.NotNull; import java.util.Date; /** - * API 错误日志创建 DTO + * API 错误日志 * * @author 芋道源码 */ @Data -@Accessors(chain = true) public class ApiErrorLogCreateReqDTO { /** @@ -105,4 +103,5 @@ public class ApiErrorLogCreateReqDTO { @NotNull(message = "异常导致的消息不能为空") private String exceptionMessage; + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java index d43eac1d5..05fb946fe 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java @@ -19,8 +19,8 @@ public class FileApiImpl implements FileApi { private FileService fileService; @Override - public String createFile(String path, byte[] content) throws Exception { - return fileService.createFile(path, content); + public String createFile(String name, String path, byte[] content) { + return fileService.createFile(name, path, content); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java new file mode 100644 index 000000000..2daa4a1c4 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.infra.api.logger; + +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; +import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * API 访问日志的 API 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ApiAccessLogApiImpl implements ApiAccessLogApi { + + @Resource + private ApiAccessLogService apiAccessLogService; + + @Override + public void createApiAccessLog(ApiAccessLogCreateReqDTO createDTO) { + apiAccessLogService.createApiAccessLog(createDTO); + } + +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java new file mode 100644 index 000000000..cdb0ec293 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.infra.api.logger; + +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; +import cn.iocoder.yudao.module.infra.service.logger.ApiErrorLogService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * API 访问日志的 API 接口 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ApiErrorLogApiImpl implements ApiErrorLogApi { + + @Resource + private ApiErrorLogService apiErrorLogService; + + @Override + public void createApiErrorLog(ApiErrorLogCreateReqDTO createDTO) { + apiErrorLogService.createApiErrorLog(createDTO); + } + +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java index 4500133ed..5ea52b7e5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; @@ -46,7 +47,7 @@ public class FileController { @OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要 public CommonResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "path", required = false) String path) throws Exception { - return success(fileService.createFile(path, IoUtil.readBytes(file.getInputStream()))); + return success(fileService.createFile(file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream()))); } @DeleteMapping("/delete") @@ -59,6 +60,7 @@ public class FileController { } @GetMapping("/{configId}/get/{path}") + @PermitAll @ApiOperation("下载文件") @ApiImplicitParams({ @ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class), diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java index 8e39a7520..10737693d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java @@ -16,6 +16,9 @@ public class FileRespVO { @ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg") private String path; + @ApiModelProperty(value = "原文件名", required = true, example = "yudao.jpg") + private String name; + @ApiModelProperty(value = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg") private String url; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/UploadRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/UploadRespVO.java new file mode 100644 index 000000000..3dc8b04e9 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/UploadRespVO.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "管理后台 - 上传文件 VO") +public class UploadRespVO { + + @ApiModelProperty(value = "文件名", required = true, example = "yudao.jpg") + private String fileName; + + @ApiModelProperty(value = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg") + private String fileUrl; +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiAccessLogConvert.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiAccessLogConvert.java index 7162d4d9a..f3a80e8c0 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiAccessLogConvert.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiAccessLogConvert.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.infra.convert.logger; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiErrorLogConvert.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiErrorLogConvert.java index 8eef7463a..778e171c7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiErrorLogConvert.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/logger/ApiErrorLogConvert.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.infra.convert.logger; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java index 4ad155e94..7e81280da 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java @@ -33,6 +33,10 @@ public class FileDO extends BaseDO { * 关联 {@link FileConfigDO#getId()} */ private Long configId; + /** + * 原文件名 + */ + private String name; /** * 路径,即文件名 */ diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java index 048411769..7f671f319 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java @@ -35,8 +35,6 @@ public class SecurityConfiguration { // Spring Boot Admin Server 的安全配置 registry.antMatchers(adminSeverContextPath).anonymous() .antMatchers(adminSeverContextPath + "/**").anonymous(); - // 文件的获取接口,可匿名访问 - registry.antMatchers(buildAdminApi("/infra/file/*/get/**"), buildAppApi("/infra/file/get/**")).permitAll(); } }; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java index 2d893c082..24baf4218 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java @@ -22,11 +22,12 @@ public interface FileService { /** * 保存文件,并返回文件的访问路径 * + * @param name 文件名称 * @param path 文件路径 * @param content 文件内容 * @return 文件路径 */ - String createFile(String path, byte[] content) throws Exception; + String createFile(String name, String path, byte[] content); /** * 删除文件 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java index 4f3736f1b..b90e92752 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java @@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.file.core.client.FileClient; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileMapper; +import lombok.SneakyThrows; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -37,12 +38,17 @@ public class FileServiceImpl implements FileService { } @Override - public String createFile(String path, byte[] content) throws Exception { + @SneakyThrows + public String createFile(String name, String path, byte[] content) { // 计算默认的 path 名 - String type = FileTypeUtil.getType(new ByteArrayInputStream(content)); + String type = FileTypeUtil.getType(new ByteArrayInputStream(content), name); if (StrUtil.isEmpty(path)) { path = DigestUtil.md5Hex(content) + '.' + type; } + // 如果 name 为空,则使用 path 填充 + if (StrUtil.isEmpty(name)) { + name = path; + } // 上传到文件存储器 FileClient client = fileConfigService.getMasterFileClient(); @@ -52,6 +58,7 @@ public class FileServiceImpl implements FileService { // 保存到数据库 FileDO file = new FileDO(); file.setConfigId(client.getId()); + file.setName(name); file.setPath(path); file.setUrl(url); file.setType(type); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java index 22aea79b4..e473b2322 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; import java.util.List; @@ -13,7 +13,14 @@ import java.util.List; * * @author 芋道源码 */ -public interface ApiAccessLogService extends ApiAccessLogFrameworkService { +public interface ApiAccessLogService { + + /** + * 创建 API 访问日志 + * + * @param createReqDTO API 访问日志 + */ + void createApiAccessLog(ApiAccessLogCreateReqDTO createReqDTO); /** * 获得 API 访问日志分页 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java index 64df85ac0..e3b3234ee 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; import cn.iocoder.yudao.module.infra.convert.logger.ApiAccessLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiAccessLogMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -26,6 +25,12 @@ public class ApiAccessLogServiceImpl implements ApiAccessLogService { @Resource private ApiAccessLogMapper apiAccessLogMapper; + @Override + public void createApiAccessLog(ApiAccessLogCreateReqDTO createDTO) { + ApiAccessLogDO apiAccessLog = ApiAccessLogConvert.INSTANCE.convert(createDTO); + apiAccessLogMapper.insert(apiAccessLog); + } + @Override public PageResult getApiAccessLogPage(ApiAccessLogPageReqVO pageReqVO) { return apiAccessLogMapper.selectPage(pageReqVO); @@ -36,11 +41,4 @@ public class ApiAccessLogServiceImpl implements ApiAccessLogService { return apiAccessLogMapper.selectList(exportReqVO); } - @Override - @Async - public void createApiAccessLogAsync(ApiAccessLogCreateReqDTO createDTO) { - ApiAccessLogDO apiAccessLog = ApiAccessLogConvert.INSTANCE.convert(createDTO); - apiAccessLogMapper.insert(apiAccessLog); - } - } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java index 2ad0479fe..138c9bef4 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; @@ -13,7 +13,14 @@ import java.util.List; * * @author 芋道源码 */ -public interface ApiErrorLogService extends ApiErrorLogFrameworkService { +public interface ApiErrorLogService { + + /** + * 创建 API 错误日志 + * + * @param createReqDTO API 错误日志 + */ + void createApiErrorLog(ApiErrorLogCreateReqDTO createReqDTO); /** * 获得 API 错误日志分页 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java index 038f47a38..d265f09f6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.convert.logger.ApiErrorLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.infra.enums.logger.ApiErrorLogProcessStatusEnum; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -30,6 +29,13 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { @Resource private ApiErrorLogMapper apiErrorLogMapper; + @Override + public void createApiErrorLog(ApiErrorLogCreateReqDTO createDTO) { + ApiErrorLogDO apiErrorLog = ApiErrorLogConvert.INSTANCE.convert(createDTO); + apiErrorLog.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); + apiErrorLogMapper.insert(apiErrorLog); + } + @Override public PageResult getApiErrorLogPage(ApiErrorLogPageReqVO pageReqVO) { return apiErrorLogMapper.selectPage(pageReqVO); @@ -54,12 +60,4 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { .processUserId(processUserId).processTime(new Date()).build()); } - @Override - @Async - public void createApiErrorLogAsync(ApiErrorLogCreateReqDTO createDTO) { - ApiErrorLogDO apiErrorLog = ApiErrorLogConvert.INSTANCE.convert(createDTO); - apiErrorLog.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); - apiErrorLogMapper.insert(apiErrorLog); - } - } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm index 3036c16ed..8b9fbaac2 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm @@ -2,6 +2,12 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac import lombok.*; import java.util.*; +#foreach ($column in $columns) +#if (${column.javaType} == "BigDecimal") +import java.math.BigDecimal; +#break +#end +#end import io.swagger.annotations.*; import javax.validation.constraints.*; ## 处理 Date 字段的引入 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm index 2ce6f28a8..6b3ea2467 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm @@ -2,6 +2,12 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac import lombok.*; import java.util.*; +#foreach ($column in $columns) +#if (${column.javaType} == "BigDecimal") +import java.math.BigDecimal; +#break +#end +#end import io.swagger.annotations.*; import com.alibaba.excel.annotation.ExcelProperty; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm index 5c22e388a..4abae1591 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm @@ -2,6 +2,12 @@ package ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.busines import lombok.*; import java.util.*; +#foreach ($column in $columns) +#if (${column.javaType} == "BigDecimal") +import java.math.BigDecimal; +#break +#end +#end import com.baomidou.mybatisplus.annotation.*; import ${BaseDOClassName}; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm index e00e465af..0edbdc1ee 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm @@ -9,6 +9,7 @@ VALUES ( ); -- 按钮父菜单ID +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 SELECT @parentId := LAST_INSERT_ID(); -- 按钮 SQL diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java index da377e79b..e61039385 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java @@ -80,9 +80,9 @@ public class FileServiceTest extends BaseDbUnitTest { String url = randomString(); when(client.upload(same(content), same(path))).thenReturn(url); when(client.getId()).thenReturn(10L); - + String name = "单测文件名"; // 调用 - String result = fileService.createFile(path, content); + String result = fileService.createFile(name, path, content); // 断言 assertEquals(result, url); // 校验数据 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java index 7ae75d9c4..5f00b3bf5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.infra.service.logger; import cn.hutool.core.util.RandomUtil; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; @@ -155,7 +155,7 @@ public class ApiAccessLogServiceImplTest extends BaseDbUnitTest { dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue())); // 调用 - apiAccessLogService.createApiAccessLogAsync(createDTO); + apiAccessLogService.createApiAccessLog(createDTO); // 断言 ApiAccessLogDO infApiAccessLogDO = apiAccessLogMapper.selectOne(null); assertNotNull(infApiAccessLogDO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java index 6c08af886..fbe9ebc05 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java @@ -1,12 +1,12 @@ package cn.iocoder.yudao.module.infra.service.logger; import cn.hutool.core.util.RandomUtil; -import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; @@ -187,7 +187,7 @@ public class ApiErrorLogServiceImplTest extends BaseDbUnitTest { dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue())); // 调用 - apiErrorLogService.createApiErrorLogAsync(createDTO); + apiErrorLogService.createApiErrorLog(createDTO); // 断言 ApiErrorLogDO infApiErrorLogDO = infApiErrorLogMapper.selectOne(null); assertNotNull(infApiErrorLogDO); diff --git a/yudao-module-mall/pom.xml b/yudao-module-mall/pom.xml new file mode 100644 index 000000000..866874852 --- /dev/null +++ b/yudao-module-mall/pom.xml @@ -0,0 +1,28 @@ + + + + yudao + cn.iocoder.boot + ${revision} + + 4.0.0 + + yudao-module-mall + pom + + ${project.artifactId} + + + market模块,主要实现营销相关功能 + 例如:营销活动、banner广告、优惠券、优惠码等功能。 + + + yudao-module-market-api + yudao-module-market-biz + yudao-module-product-api + yudao-module-product-biz + + + diff --git a/yudao-module-mall/yudao-module-market-api/pom.xml b/yudao-module-mall/yudao-module-market-api/pom.xml new file mode 100644 index 000000000..fef3428fc --- /dev/null +++ b/yudao-module-mall/yudao-module-market-api/pom.xml @@ -0,0 +1,26 @@ + + + + cn.iocoder.boot + yudao-module-mall + ${revision} + + 4.0.0 + yudao-module-market-api + jar + + ${project.artifactId} + + market 模块 API,暴露给其它模块调用 + + + + + cn.iocoder.boot + yudao-common + + + + diff --git a/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/api/package-info.java b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/api/package-info.java new file mode 100644 index 000000000..cb45004b6 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/api/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位 + */ +package cn.iocoder.yudao.module.market.api; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/ErrorCodeConstants.java b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/ErrorCodeConstants.java new file mode 100644 index 000000000..d63b52465 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/ErrorCodeConstants.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.market.enums; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; + +/** + * market 错误码枚举类 + *

+ * market 系统,使用 1-003-000-000 段 + */ +public interface ErrorCodeConstants { + + + // ========== 促销活动相关 1003001000============ + ErrorCode ACTIVITY_NOT_EXISTS = new ErrorCode(1003001000, "促销活动不存在"); + + // ========== banner相关 1003002000============ + ErrorCode BANNER_NOT_EXISTS = new ErrorCode(1003002000, "Banner不存在"); +} diff --git a/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityStatusEnum.java b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityStatusEnum.java new file mode 100644 index 000000000..a02b0269c --- /dev/null +++ b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityStatusEnum.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.market.enums.activity; + +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; + +import java.util.Arrays; + +/** + * 促销活动状态枚举 + */ +public enum MarketActivityStatusEnum implements IntArrayValuable { + + WAIT(10, "未开始"), + RUN(20, "进行中"), + END(30, "已结束"), + /** + * 1. WAIT、RUN、END 可以转换成 INVALID 状态。 + * 2. INVALID 只可以转换成 DELETED 状态。 + */ + INVALID(40, "已撤销"), + DELETED(50, "已删除"), + ; + + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MarketActivityStatusEnum::getValue).toArray(); + + /** + * 状态值 + */ + private final Integer value; + /** + * 状态名 + */ + private final String name; + + MarketActivityStatusEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + } + + @Override + public int[] array() { + return ARRAYS; + } +} diff --git a/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityTypeEnum.java b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityTypeEnum.java new file mode 100644 index 000000000..0413dba66 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-api/src/main/java/cn/iocoder/yudao/module/market/enums/activity/MarketActivityTypeEnum.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.market.enums.activity; + +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; + +import java.util.Arrays; + +/** + * 促销活动类型枚举 + */ +public enum MarketActivityTypeEnum implements IntArrayValuable { + + TIME_LIMITED_DISCOUNT(1, "限时折扣"), + FULL_PRIVILEGE(2, "满减送"), + ; + + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MarketActivityTypeEnum::getValue).toArray(); + + /** + * 类型值 + */ + private final Integer value; + /** + * 类型名 + */ + private final String name; + + MarketActivityTypeEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + } + + @Override + public int[] array() { + return ARRAYS; + } +} diff --git a/yudao-module-mall/yudao-module-market-biz/pom.xml b/yudao-module-mall/yudao-module-market-biz/pom.xml new file mode 100644 index 000000000..e7fa33e9d --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/pom.xml @@ -0,0 +1,61 @@ + + + + cn.iocoder.boot + yudao-module-mall + ${revision} + + 4.0.0 + jar + yudao-module-market-biz + + ${project.artifactId} + + + market模块,主要实现营销相关功能 + 例如:营销活动、banner广告、优惠券、优惠码等功能。 + + + + + cn.iocoder.boot + yudao-module-market-api + ${revision} + + + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-operatelog + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-weixin + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-tenant + + + + + cn.iocoder.boot + yudao-spring-boot-starter-web + + + + + cn.iocoder.boot + yudao-spring-boot-starter-mybatis + + + + + cn.iocoder.boot + yudao-spring-boot-starter-test + + + + diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/MarketTestController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/MarketTestController.java new file mode 100644 index 000000000..49b83b6c9 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/MarketTestController.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.market.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "管理后台 - 营销") +@RestController +@RequestMapping("/market/test") +@Validated +public class MarketTestController { + + @GetMapping("/get") + @ApiOperation("获取 market 信息") + public CommonResult get() { + return success("true"); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/ActivityController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/ActivityController.java new file mode 100644 index 000000000..dac4211a6 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/ActivityController.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.annotations.*; +import javax.validation.*; +import java.util.*; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; +import cn.iocoder.yudao.module.market.convert.activity.ActivityConvert; +import cn.iocoder.yudao.module.market.service.activity.ActivityService; + +@Api(tags = "管理后台 - 促销活动") +@RestController +@RequestMapping("/market/activity") +@Validated +public class ActivityController { + + @Resource + private ActivityService activityService; + + @PostMapping("/create") + @ApiOperation("创建促销活动") + @PreAuthorize("@ss.hasPermission('market:activity:create')") + public CommonResult createActivity(@Valid @RequestBody ActivityCreateReqVO createReqVO) { + return success(activityService.createActivity(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新促销活动") + @PreAuthorize("@ss.hasPermission('market:activity:update')") + public CommonResult updateActivity(@Valid @RequestBody ActivityUpdateReqVO updateReqVO) { + activityService.updateActivity(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除促销活动") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('market:activity:delete')") + public CommonResult deleteActivity(@RequestParam("id") Long id) { + activityService.deleteActivity(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得促销活动") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('market:activity:query')") + public CommonResult getActivity(@RequestParam("id") Long id) { + ActivityDO activity = activityService.getActivity(id); + return success(ActivityConvert.INSTANCE.convert(activity)); + } + + @GetMapping("/list") + @ApiOperation("获得促销活动列表") + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @PreAuthorize("@ss.hasPermission('market:activity:query')") + public CommonResult> getActivityList(@RequestParam("ids") Collection ids) { + List list = activityService.getActivityList(ids); + return success(ActivityConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("获得促销活动分页") + @PreAuthorize("@ss.hasPermission('market:activity:query')") + public CommonResult> getActivityPage(@Valid ActivityPageReqVO pageVO) { + PageResult pageResult = activityService.getActivityPage(pageVO); + return success(ActivityConvert.INSTANCE.convertPage(pageResult)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityBaseVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityBaseVO.java new file mode 100644 index 000000000..3ae5cd679 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityBaseVO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.market.enums.activity.MarketActivityStatusEnum; +import cn.iocoder.yudao.module.market.enums.activity.MarketActivityTypeEnum; +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** +* 促销活动 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ActivityBaseVO { + + @ApiModelProperty(value = "活动标题", required = true) + @NotNull(message = "活动标题不能为空") + private String title; + + @ApiModelProperty(value = "活动类型", required = true) + @NotNull(message = "活动类型不能为空") + @InEnum(MarketActivityTypeEnum.class) + private Integer activityType; + + @ApiModelProperty(value = "活动状态", required = true) + @NotNull(message = "活动状态不能为空") + @InEnum(MarketActivityStatusEnum.class) + private Integer status; + + @ApiModelProperty(value = "开始时间", required = true) + @NotNull(message = "开始时间不能为空") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date startTime; + + @ApiModelProperty(value = "结束时间", required = true) + @NotNull(message = "结束时间不能为空") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date endTime; + + @ApiModelProperty(value = "失效时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date invalidTime; + + @ApiModelProperty(value = "删除时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date deleteTime; + + @ApiModelProperty(value = "限制折扣字符串,使用 JSON 序列化成字符串存储") + private String timeLimitedDiscount; + + @ApiModelProperty(value = "限制折扣字符串,使用 JSON 序列化成字符串存储") + private String fullPrivilege; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityCreateReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityCreateReqVO.java new file mode 100644 index 000000000..0ca112709 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityCreateReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** + * @author xia + */ +@ApiModel("管理后台 - 促销活动创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ActivityCreateReqVO extends ActivityBaseVO { + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityPageReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityPageReqVO.java new file mode 100644 index 000000000..f3a4155b0 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityPageReqVO.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.market.enums.activity.MarketActivityStatusEnum; +import cn.iocoder.yudao.module.market.enums.activity.MarketActivityTypeEnum; +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 促销活动分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ActivityPageReqVO extends PageParam { + + @ApiModelProperty(value = "活动标题") + private String title; + + @ApiModelProperty(value = "活动类型") + @InEnum(MarketActivityTypeEnum.class) + private Integer activityType; + + @ApiModelProperty(value = "活动状态") + @InEnum(MarketActivityStatusEnum.class) + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始开始时间") + private Date beginStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束开始时间") + private Date endStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始结束时间") + private Date beginEndTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束结束时间") + private Date endEndTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始失效时间") + private Date beginInvalidTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束失效时间") + private Date endInvalidTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始删除时间") + private Date beginDeleteTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束删除时间") + private Date endDeleteTime; + + @ApiModelProperty(value = "限制折扣字符串,使用 JSON 序列化成字符串存储") + private String timeLimitedDiscount; + + @ApiModelProperty(value = "限制折扣字符串,使用 JSON 序列化成字符串存储") + private String fullPrivilege; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityRespVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityRespVO.java new file mode 100644 index 000000000..de7ca3af2 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 促销活动 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ActivityRespVO extends ActivityBaseVO { + + @ApiModelProperty(value = "活动编号", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityUpdateReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityUpdateReqVO.java new file mode 100644 index 000000000..1db24f259 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/activity/vo/ActivityUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.market.controller.admin.activity.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 促销活动更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ActivityUpdateReqVO extends ActivityBaseVO { + + @ApiModelProperty(value = "活动编号", required = true) + @NotNull(message = "活动编号不能为空") + private Long id; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/BannerController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/BannerController.java new file mode 100644 index 000000000..932ead7de --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/BannerController.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.*; +import cn.iocoder.yudao.module.market.convert.banner.BannerConvert; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import cn.iocoder.yudao.module.market.service.banner.BannerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "管理后台 - Banner 管理") +@RestController +@RequestMapping("/market/banner") +@Validated +public class BannerController { + + @Resource + private BannerService bannerService; + + @PostMapping("/create") + @ApiOperation("创建 Banner") + @PreAuthorize("@ss.hasPermission('market:banner:create')") + public CommonResult createBanner(@Valid @RequestBody BannerCreateReqVO createReqVO) { + return success(bannerService.createBanner(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新 Banner") + @PreAuthorize("@ss.hasPermission('market:banner:update')") + public CommonResult updateBanner(@Valid @RequestBody BannerUpdateReqVO updateReqVO) { + bannerService.updateBanner(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除 Banner") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('market:banner:delete')") + public CommonResult deleteBanner(@RequestParam("id") Long id) { + bannerService.deleteBanner(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得 Banner") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('market:banner:query')") + public CommonResult getBanner(@RequestParam("id") Long id) { + BannerDO banner = bannerService.getBanner(id); + return success(BannerConvert.INSTANCE.convert(banner)); + } + + @GetMapping("/page") + @ApiOperation("获得 Banner 分页") + @PreAuthorize("@ss.hasPermission('market:banner:query')") + public CommonResult> getBannerPage(@Valid BannerPageReqVO pageVO) { + PageResult pageResult = bannerService.getBannerPage(pageVO); + return success(BannerConvert.INSTANCE.convertPage(pageResult)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerBaseVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerBaseVO.java new file mode 100644 index 000000000..f5f37dbbc --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerBaseVO.java @@ -0,0 +1,42 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner.vo; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.validation.InEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * Banner Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + * @author xia + */ +@Data +public class BannerBaseVO { + + @ApiModelProperty(value = "标题", required = true) + @NotNull(message = "标题不能为空") + private String title; + + @ApiModelProperty(value = "跳转链接", required = true) + @NotNull(message = "跳转链接不能为空") + private String url; + + @ApiModelProperty(value = "图片地址", required = true) + @NotNull(message = "图片地址不能为空") + private String picUrl; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; + + @ApiModelProperty(value = "状态", required = true) + @NotNull(message = "状态不能为空") + @InEnum(CommonStatusEnum.class) + private Integer status; + + @ApiModelProperty(value = "备注") + private String memo; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerCreateReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerCreateReqVO.java new file mode 100644 index 000000000..0bb0c1bcf --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerCreateReqVO.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.Date; + +/** + * @author xia + */ +@ApiModel("管理后台 - Banner 创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BannerCreateReqVO extends BannerBaseVO { + + + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerPageReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerPageReqVO.java new file mode 100644 index 000000000..79a9c40c7 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerPageReqVO.java @@ -0,0 +1,42 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner.vo; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.validation.InEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * @author xia + */ +@ApiModel("管理后台 - Banner 分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BannerPageReqVO extends PageParam { + + @ApiModelProperty(value = "标题") + private String title; + + + @ApiModelProperty(value = "状态") + @InEnum(CommonStatusEnum.class) + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerRespVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerRespVO.java new file mode 100644 index 000000000..f4045b991 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerRespVO.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author xia + */ +@ApiModel("管理后台 - Banner Response VO") +@Data +@ToString(callSuper = true) +public class BannerRespVO extends BannerBaseVO { + + @ApiModelProperty(value = "banner编号", required = true) + @NotNull(message = "banner编号不能为空") + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerUpdateReqVO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerUpdateReqVO.java new file mode 100644 index 000000000..1f2d7ce80 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/admin/banner/vo/BannerUpdateReqVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.market.controller.admin.banner.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotNull; + +/** + * @author xia + */ +@ApiModel("管理后台 - Banner更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BannerUpdateReqVO extends BannerBaseVO { + + @ApiModelProperty(value = "banner 编号", required = true) + @NotNull(message = "banner 编号不能为空") + private Long id; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/AppMarketTestController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/AppMarketTestController.java new file mode 100644 index 000000000..7d45b87a9 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/AppMarketTestController.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.market.controller.app; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "用户 App - 营销") +@RestController +@RequestMapping("/market/test") +@Validated +public class AppMarketTestController { + + @GetMapping("/get") + @ApiOperation("获取 market 信息") + public CommonResult get() { + return success("true"); + } +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java new file mode 100644 index 000000000..3d9d58eb8 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.market.controller.app.banner; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerRespVO; +import cn.iocoder.yudao.module.market.convert.banner.BannerConvert; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import cn.iocoder.yudao.module.market.service.banner.BannerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * @author: XIA + */ +@RestController +@RequestMapping("/market/banner") +@Api(tags = "用户APP- 首页Banner") +@Validated +public class AppBannerController { + + // TODO @xia:使用 @Resource 哈 + @Autowired + private BannerService bannerService; + + // TODO @xia:新建一个 AppBannerRespVO,只返回必要的字段。status 要过滤下。然后 sort 下结果 + @GetMapping("/list") + @ApiOperation("获得banner列表") + @PreAuthorize("@ss.hasPermission('market:banner:query')") + public CommonResult> getBannerList() { + List list = bannerService.getBannerList(); + return success(BannerConvert.INSTANCE.convertList(list)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/activity/ActivityConvert.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/activity/ActivityConvert.java new file mode 100644 index 000000000..64ba73975 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/activity/ActivityConvert.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.market.convert.activity; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; + +/** + * 促销活动 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ActivityConvert { + + ActivityConvert INSTANCE = Mappers.getMapper(ActivityConvert.class); + + ActivityDO convert(ActivityCreateReqVO bean); + + ActivityDO convert(ActivityUpdateReqVO bean); + + ActivityRespVO convert(ActivityDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/banner/BannerConvert.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/banner/BannerConvert.java new file mode 100644 index 000000000..a78650f57 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/convert/banner/BannerConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.market.convert.banner; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerCreateReqVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerRespVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerUpdateReqVO; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * Banner Convert + * + * @author xia + */ +@Mapper +public interface BannerConvert { + + BannerConvert INSTANCE = Mappers.getMapper(BannerConvert.class); + + + List convertList(List list); + + PageResult convertPage(PageResult pageResult); + + BannerRespVO convert(BannerDO banner); + + BannerDO convert(BannerCreateReqVO createReqVO); + + BannerDO convert(BannerUpdateReqVO updateReqVO); + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/activity/ActivityDO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/activity/ActivityDO.java new file mode 100644 index 000000000..13dcbf67c --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/activity/ActivityDO.java @@ -0,0 +1,64 @@ +package cn.iocoder.yudao.module.market.dal.dataobject.activity; + +import lombok.*; +import java.util.*; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 促销活动 DO + * + * @author 芋道源码 + */ +@TableName("market_activity") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ActivityDO extends BaseDO { + + /** + * 活动编号 + */ + @TableId + private Long id; + /** + * 活动标题 + */ + private String title; + /** + * 活动类型MarketActivityTypeEnum + */ + private Integer activityType; + /** + * 活动状态MarketActivityStatusEnum + */ + private Integer status; + /** + * 开始时间 + */ + private Date startTime; + /** + * 结束时间 + */ + private Date endTime; + /** + * 失效时间 + */ + private Date invalidTime; + /** + * 删除时间 + */ + private Date deleteTime; + /** + * 限制折扣字符串,使用 JSON 序列化成字符串存储 + */ + private String timeLimitedDiscount; + /** + * 限制折扣字符串,使用 JSON 序列化成字符串存储 + */ + private String fullPrivilege; + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/banner/BannerDO.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/banner/BannerDO.java new file mode 100644 index 000000000..1f48f7144 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/dataobject/banner/BannerDO.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.market.dal.dataobject.banner; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * banner DO + * + * @author xia + */ +@TableName("market_banner") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BannerDO extends BaseDO { + + /** + * 编号 + */ + private Long id; + /** + * 标题 + */ + private String title; + /** + * 跳转链接 + */ + private String url; + /** + * 图片链接 + */ + private String picUrl; + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} + */ + private Integer status; + /** + * 备注 + */ + private String memo; + + // TODO 芋艿 点击次数。&& 其他数据相关 + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/activity/ActivityMapper.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/activity/ActivityMapper.java new file mode 100644 index 000000000..b786ad981 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/activity/ActivityMapper.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.market.dal.mysql.activity; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; + +/** + * 促销活动 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ActivityMapper extends BaseMapperX { + + default PageResult selectPage(ActivityPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ActivityDO::getTitle, reqVO.getTitle()) + .eqIfPresent(ActivityDO::getActivityType, reqVO.getActivityType()) + .eqIfPresent(ActivityDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ActivityDO::getStartTime, reqVO.getBeginStartTime(), reqVO.getEndStartTime()) + .betweenIfPresent(ActivityDO::getEndTime, reqVO.getBeginEndTime(), reqVO.getEndEndTime()) + .betweenIfPresent(ActivityDO::getInvalidTime, reqVO.getBeginInvalidTime(), reqVO.getEndInvalidTime()) + .betweenIfPresent(ActivityDO::getDeleteTime, reqVO.getBeginDeleteTime(), reqVO.getEndDeleteTime()) + .eqIfPresent(ActivityDO::getTimeLimitedDiscount, reqVO.getTimeLimitedDiscount()) + .eqIfPresent(ActivityDO::getFullPrivilege, reqVO.getFullPrivilege()) + .betweenIfPresent(ActivityDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ActivityDO::getId)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/banner/BannerMapper.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/banner/BannerMapper.java new file mode 100644 index 000000000..05c8cd3c9 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/dal/mysql/banner/BannerMapper.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.market.dal.mysql.banner; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerPageReqVO; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * Banner Mapper + * + * @author xia + */ +@Mapper +public interface BannerMapper extends BaseMapperX { + + default PageResult selectPage(BannerPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(BannerDO::getTitle, reqVO.getTitle()) + .eqIfPresent(BannerDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(BannerDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .betweenIfPresent(BannerDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(BannerDO::getSort)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/package-info.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/package-info.java new file mode 100644 index 000000000..2efde4ec7 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/package-info.java @@ -0,0 +1,8 @@ +/** + * market 模块,我们放营销业务。 + * 例如说:营销活动、banner、优惠券等等 + * + * 1. Controller URL:以 /market/ 开头,避免和其它 Module 冲突 + * 2. DataObject 表名:以 market_ 开头,方便在数据库中区分 + */ +package cn.iocoder.yudao.module.market; diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityService.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityService.java new file mode 100644 index 000000000..1d5e27857 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityService.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.market.service.activity; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 促销活动 Service 接口 + * + * @author 芋道源码 + */ +public interface ActivityService { + + /** + * 创建促销活动 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createActivity(@Valid ActivityCreateReqVO createReqVO); + + /** + * 更新促销活动 + * + * @param updateReqVO 更新信息 + */ + void updateActivity(@Valid ActivityUpdateReqVO updateReqVO); + + /** + * 删除促销活动 + * + * @param id 编号 + */ + void deleteActivity(Long id); + + /** + * 获得促销活动 + * + * @param id 编号 + * @return 促销活动 + */ + ActivityDO getActivity(Long id); + + /** + * 获得促销活动列表 + * + * @param ids 编号 + * @return 促销活动列表 + */ + List getActivityList(Collection ids); + + /** + * 获得促销活动分页 + * + * @param pageReqVO 分页查询 + * @return 促销活动分页 + */ + PageResult getActivityPage(ActivityPageReqVO pageReqVO); + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImpl.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImpl.java new file mode 100644 index 000000000..57bb9af53 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImpl.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.market.service.activity; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.market.convert.activity.ActivityConvert; +import cn.iocoder.yudao.module.market.dal.mysql.activity.ActivityMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.market.enums.ErrorCodeConstants.*; + +/** + * 促销活动 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ActivityServiceImpl implements ActivityService { + + @Resource + private ActivityMapper activityMapper; + + @Override + public Long createActivity(ActivityCreateReqVO createReqVO) { + // 插入 + ActivityDO activity = ActivityConvert.INSTANCE.convert(createReqVO); + activityMapper.insert(activity); + // 返回 + return activity.getId(); + } + + @Override + public void updateActivity(ActivityUpdateReqVO updateReqVO) { + // 校验存在 + this.validateActivityExists(updateReqVO.getId()); + // 更新 + ActivityDO updateObj = ActivityConvert.INSTANCE.convert(updateReqVO); + activityMapper.updateById(updateObj); + } + + @Override + public void deleteActivity(Long id) { + // 校验存在 + this.validateActivityExists(id); + // 删除 + activityMapper.deleteById(id); + } + + private void validateActivityExists(Long id) { + if (activityMapper.selectById(id) == null) { + throw exception(ACTIVITY_NOT_EXISTS); + } + } + + @Override + public ActivityDO getActivity(Long id) { + return activityMapper.selectById(id); + } + + @Override + public List getActivityList(Collection ids) { + return activityMapper.selectBatchIds(ids); + } + + @Override + public PageResult getActivityPage(ActivityPageReqVO pageReqVO) { + return activityMapper.selectPage(pageReqVO); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java new file mode 100644 index 000000000..67debdc3d --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.market.service.banner; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerCreateReqVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerPageReqVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerUpdateReqVO; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; + +import javax.validation.Valid; +import java.util.List; + +/** + * 首页 Banner Service 接口 + * + * @author xia + */ +public interface BannerService { + + /** + * 创建 Banner + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createBanner(@Valid BannerCreateReqVO createReqVO); + + /** + * 更新 Banner + * + * @param updateReqVO 更新信息 + */ + void updateBanner(@Valid BannerUpdateReqVO updateReqVO); + + /** + * 删除 Banner + * + * @param id 编号 + */ + void deleteBanner(Long id); + + /** + * 获得 Banner + * + * @param id 编号 + * @return Banner + */ + BannerDO getBanner(Long id); + + /** + * 获得所有 Banner列表 + * @return Banner列表 + */ + List getBannerList(); + + /** + * 获得 Banner 分页 + * + * @param pageReqVO 分页查询 + * @return Banner分页 + */ + PageResult getBannerPage(BannerPageReqVO pageReqVO); + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java new file mode 100644 index 000000000..04784ff66 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java @@ -0,0 +1,78 @@ +package cn.iocoder.yudao.module.market.service.banner; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerCreateReqVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerPageReqVO; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerUpdateReqVO; +import cn.iocoder.yudao.module.market.convert.banner.BannerConvert; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import cn.iocoder.yudao.module.market.dal.mysql.banner.BannerMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.market.enums.ErrorCodeConstants.BANNER_NOT_EXISTS; + +/** + * 首页banner 实现类 + * + * @author xia + */ +@Service +@Validated +public class BannerServiceImpl implements BannerService { + + @Resource + private BannerMapper bannerMapper; + + @Override + public Long createBanner(BannerCreateReqVO createReqVO) { + // 插入 + BannerDO banner = BannerConvert.INSTANCE.convert(createReqVO); + bannerMapper.insert(banner); + // 返回 + return banner.getId(); + } + + @Override + public void updateBanner(BannerUpdateReqVO updateReqVO) { + // 校验存在 + this.validateBannerExists(updateReqVO.getId()); + // 更新 + BannerDO updateObj = BannerConvert.INSTANCE.convert(updateReqVO); + bannerMapper.updateById(updateObj); + } + + @Override + public void deleteBanner(Long id) { + // 校验存在 + this.validateBannerExists(id); + // 删除 + bannerMapper.deleteById(id); + } + + private void validateBannerExists(Long id) { + if (bannerMapper.selectById(id) == null) { + throw exception(BANNER_NOT_EXISTS); + } + } + + @Override + public BannerDO getBanner(Long id) { + return bannerMapper.selectById(id); + } + + @Override + public List getBannerList() { + return bannerMapper.selectList(); + } + + @Override + public PageResult getBannerPage(BannerPageReqVO pageReqVO) { + return bannerMapper.selectPage(pageReqVO); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java b/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java new file mode 100644 index 000000000..f5b9a8b50 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java @@ -0,0 +1,202 @@ +package cn.iocoder.yudao.module.market.service.activity; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import javax.annotation.Resource; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; + +import cn.iocoder.yudao.module.market.controller.admin.activity.vo.*; +import cn.iocoder.yudao.module.market.dal.dataobject.activity.ActivityDO; +import cn.iocoder.yudao.module.market.dal.mysql.activity.ActivityMapper; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.springframework.context.annotation.Import; + +import static cn.iocoder.yudao.module.market.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; +import static org.junit.jupiter.api.Assertions.*; + +/** +* {@link ActivityServiceImpl} 的单元测试类 +* +* @author 芋道源码 +*/ +@Import(ActivityServiceImpl.class) +public class ActivityServiceImplTest extends BaseDbUnitTest { + + @Resource + private ActivityServiceImpl activityService; + + @Resource + private ActivityMapper activityMapper; + + @Test + public void testCreateActivity_success() { + // 准备参数 + ActivityCreateReqVO reqVO = randomPojo(ActivityCreateReqVO.class); + + // 调用 + Long activityId = activityService.createActivity(reqVO); + // 断言 + assertNotNull(activityId); + // 校验记录的属性是否正确 + ActivityDO activity = activityMapper.selectById(activityId); + assertPojoEquals(reqVO, activity); + } + + @Test + public void testUpdateActivity_success() { + // mock 数据 + ActivityDO dbActivity = randomPojo(ActivityDO.class); + activityMapper.insert(dbActivity);// @Sql: 先插入出一条存在的数据 + // 准备参数 + ActivityUpdateReqVO reqVO = randomPojo(ActivityUpdateReqVO.class, o -> { + o.setId(dbActivity.getId()); // 设置更新的 ID + }); + + // 调用 + activityService.updateActivity(reqVO); + // 校验是否更新正确 + ActivityDO activity = activityMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, activity); + } + + @Test + public void testUpdateActivity_notExists() { + // 准备参数 + ActivityUpdateReqVO reqVO = randomPojo(ActivityUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> activityService.updateActivity(reqVO), ACTIVITY_NOT_EXISTS); + } + + @Test + public void testDeleteActivity_success() { + // mock 数据 + ActivityDO dbActivity = randomPojo(ActivityDO.class); + activityMapper.insert(dbActivity);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbActivity.getId(); + + // 调用 + activityService.deleteActivity(id); + // 校验数据不存在了 + assertNull(activityMapper.selectById(id)); + } + + @Test + public void testDeleteActivity_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> activityService.deleteActivity(id), ACTIVITY_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetActivityPage() { + // mock 数据 + ActivityDO dbActivity = randomPojo(ActivityDO.class, o -> { // 等会查询到 + o.setTitle(null); + o.setActivityType(null); + o.setStatus(null); + o.setStartTime(null); + o.setEndTime(null); + o.setInvalidTime(null); + o.setDeleteTime(null); + o.setTimeLimitedDiscount(null); + o.setFullPrivilege(null); + o.setCreateTime(null); + }); + activityMapper.insert(dbActivity); + // 测试 title 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setTitle(null))); + // 测试 activityType 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setActivityType(null))); + // 测试 status 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setStatus(null))); + // 测试 startTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setStartTime(null))); + // 测试 endTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setEndTime(null))); + // 测试 invalidTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setInvalidTime(null))); + // 测试 deleteTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setDeleteTime(null))); + // 测试 timeLimitedDiscount 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setTimeLimitedDiscount(null))); + // 测试 fullPrivilege 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setFullPrivilege(null))); + // 测试 createTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setCreateTime(null))); + // 准备参数 + ActivityPageReqVO reqVO = new ActivityPageReqVO(); + reqVO.setTitle(null); + reqVO.setActivityType(null); + reqVO.setStatus(null); + reqVO.setBeginStartTime(null); + reqVO.setEndStartTime(null); + reqVO.setBeginEndTime(null); + reqVO.setEndEndTime(null); + reqVO.setBeginInvalidTime(null); + reqVO.setEndInvalidTime(null); + reqVO.setBeginDeleteTime(null); + reqVO.setEndDeleteTime(null); + reqVO.setTimeLimitedDiscount(null); + reqVO.setFullPrivilege(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + PageResult pageResult = activityService.getActivityPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbActivity, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetActivityList() { + // mock 数据 + ActivityDO dbActivity = randomPojo(ActivityDO.class, o -> { // 等会查询到 + o.setTitle(null); + o.setActivityType(null); + o.setStatus(null); + o.setStartTime(null); + o.setEndTime(null); + o.setInvalidTime(null); + o.setDeleteTime(null); + o.setTimeLimitedDiscount(null); + o.setFullPrivilege(null); + o.setCreateTime(null); + }); + activityMapper.insert(dbActivity); + // 测试 title 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setTitle(null))); + // 测试 activityType 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setActivityType(null))); + // 测试 status 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setStatus(null))); + // 测试 startTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setStartTime(null))); + // 测试 endTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setEndTime(null))); + // 测试 invalidTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setInvalidTime(null))); + // 测试 deleteTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setDeleteTime(null))); + // 测试 timeLimitedDiscount 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setTimeLimitedDiscount(null))); + // 测试 fullPrivilege 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setFullPrivilege(null))); + // 测试 createTime 不匹配 + activityMapper.insert(cloneIgnoreId(dbActivity, o -> o.setCreateTime(null))); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/resources/application-unit-test.yaml b/yudao-module-mall/yudao-module-market-biz/src/test/resources/application-unit-test.yaml new file mode 100644 index 000000000..60914d97f --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/test/resources/application-unit-test.yaml @@ -0,0 +1,49 @@ +spring: + main: + lazy-initialization: true # 开启懒加载,加快速度 + banner-mode: off # 单元测试,禁用 Banner + +--- #################### 数据库相关配置 #################### + +spring: + # 数据源配置项 + datasource: + name: ruoyi-vue-pro + url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写 + driver-class-name: org.h2.Driver + username: sa + password: + druid: + async-init: true # 单元测试,异步初始化 Druid 连接池,提升启动速度 + initial-size: 1 # 单元测试,配置为 1,提升启动速度 + sql: + init: + schema-locations: classpath:/sql/create_tables.sql + + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 + redis: + host: 127.0.0.1 # 地址 + port: 16379 # 端口(单元测试,使用 16379 端口) + database: 0 # 数据库索引 + +mybatis: + lazy-initialization: true # 单元测试,设置 MyBatis Mapper 延迟加载,加速每个单元测试 + +--- #################### 定时任务相关配置 #################### + +--- #################### 配置中心相关配置 #################### + +--- #################### 服务保障相关配置 #################### + +# Lock4j 配置项(单元测试,禁用 Lock4j) + +# Resilience4j 配置项 + +--- #################### 监控相关配置 #################### + +--- #################### 芋道相关配置 #################### + +# 芋道配置项,设置当前项目所有自定义的配置 +yudao: + info: + base-package: cn.iocoder.yudao.module diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/resources/logback.xml b/yudao-module-mall/yudao-module-market-biz/src/test/resources/logback.xml new file mode 100644 index 000000000..daf756bff --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/test/resources/logback.xml @@ -0,0 +1,4 @@ + + + + diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/clean.sql b/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/clean.sql new file mode 100644 index 000000000..abad7c069 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/clean.sql @@ -0,0 +1 @@ +DELETE FROM "market_activity"; diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/create_tables.sql new file mode 100644 index 000000000..3f3ce3c4d --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/test/resources/sql/create_tables.sql @@ -0,0 +1,19 @@ +CREATE TABLE IF NOT EXISTS "market_activity" ( + "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "title" varchar(50) NOT NULL, + "activity_type" tinyint(4) NOT NULL, + "status" tinyint(4) NOT NULL, + "start_time" datetime NOT NULL, + "end_time" datetime NOT NULL, + "invalid_time" datetime, + "delete_time" datetime, + "time_limited_discount" varchar(2000), + "full_privilege" varchar(2000), + "creator" varchar(64) DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint(20) NOT NULL, + PRIMARY KEY ("id") + ) COMMENT '促销活动'; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-api/pom.xml b/yudao-module-mall/yudao-module-product-api/pom.xml new file mode 100644 index 000000000..7eb38008a --- /dev/null +++ b/yudao-module-mall/yudao-module-product-api/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + cn.iocoder.boot + yudao-module-mall + ${revision} + + + yudao-module-product-api + jar + + ${project.artifactId} + + product 模块 API,暴露给其它模块调用 + + + + + cn.iocoder.boot + yudao-common + + + + \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java new file mode 100644 index 000000000..b19092853 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位 + */ +package cn.iocoder.yudao.module.product.api; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java new file mode 100644 index 000000000..e328d2512 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.product.enums; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; + +/** + * product 错误码枚举类 + *

+ * product 系统,使用 1-008-000-000 段 + */ +public interface ErrorCodeConstants { + + // ========== 商品分类相关 1008001000============ + ErrorCode CATEGORY_NOT_EXISTS = new ErrorCode(1008001000, "商品分类不存在"); + ErrorCode CATEGORY_PARENT_NOT_EXISTS = new ErrorCode(1008001001, "父分类不存在"); + ErrorCode CATEGORY_EXISTS_CHILDREN = new ErrorCode(1008001002, "存在子分类,无法删除"); + + // ========== 品牌相关编号 1008002000 ========== + ErrorCode BRAND_NOT_EXISTS = new ErrorCode(1008002000, "品牌不存在"); + + // ========== 规格名称 1008003000 ========== + ErrorCode PROPERTY_NOT_EXISTS = new ErrorCode(1008003000, "规格名称不存在"); + + // ========== 规格值 1008004000 ========== + ErrorCode PROPERTY_VALUE_NOT_EXISTS = new ErrorCode(1008004000, "规格值不存在"); + + // ========== 商品spu 1008005000 ========== + ErrorCode SPU_NOT_EXISTS = new ErrorCode(1008005000, "商品spu不存在"); + + // ========== 商品sku 1008006000 ========== + ErrorCode SKU_NOT_EXISTS = new ErrorCode(1008006000, "商品sku不存在"); + ErrorCode SKU_PROPERTIES_DUPLICATED = new ErrorCode(1008006001, "商品sku的属性组合存在重复"); +} diff --git a/yudao-module-mall/yudao-module-product-biz/pom.xml b/yudao-module-mall/yudao-module-product-biz/pom.xml new file mode 100644 index 000000000..a06f8937c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + cn.iocoder.boot + yudao-module-mall + ${revision} + + + yudao-module-product-biz + jar + + ${project.artifactId} + + product 模块,主要实现商品相关功能 + 例如:品牌、商品分类、spu、sku等功能。 + + + + + + cn.iocoder.boot + yudao-module-product-api + ${revision} + + + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-operatelog + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-weixin + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-tenant + + + + + cn.iocoder.boot + yudao-spring-boot-starter-web + + + cn.iocoder.boot + yudao-spring-boot-starter-excel + + + + + cn.iocoder.boot + yudao-spring-boot-starter-mybatis + + + + + cn.iocoder.boot + yudao-spring-boot-starter-test + + + + + \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/BrandController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/BrandController.java new file mode 100644 index 000000000..0702d206c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/BrandController.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; +import cn.iocoder.yudao.module.product.convert.brand.BrandConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; +import cn.iocoder.yudao.module.product.service.brand.BrandService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Api(tags = "管理后台 - 品牌") +@RestController +@RequestMapping("/product/brand") +@Validated +public class BrandController { + + @Resource + private BrandService brandService; + + @PostMapping("/create") + @ApiOperation("创建品牌") + @PreAuthorize("@ss.hasPermission('product:brand:create')") + public CommonResult createBrand(@Valid @RequestBody BrandCreateReqVO createReqVO) { + return success(brandService.createBrand(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新品牌") + @PreAuthorize("@ss.hasPermission('product:brand:update')") + public CommonResult updateBrand(@Valid @RequestBody BrandUpdateReqVO updateReqVO) { + brandService.updateBrand(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除品牌") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:brand:delete')") + public CommonResult deleteBrand(@RequestParam("id") Long id) { + brandService.deleteBrand(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得品牌") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:brand:query')") + public CommonResult getBrand(@RequestParam("id") Long id) { + BrandDO brand = brandService.getBrand(id); + return success(BrandConvert.INSTANCE.convert(brand)); + } + + @GetMapping("/page") + @ApiOperation("获得品牌分页") + @PreAuthorize("@ss.hasPermission('product:brand:query')") + public CommonResult> getBrandPage(@Valid BrandPageReqVO pageVO) { + PageResult pageResult = brandService.getBrandPage(pageVO); + return success(BrandConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出品牌 Excel") + @PreAuthorize("@ss.hasPermission('product:brand:export')") + @OperateLog(type = EXPORT) + public void exportBrandExcel(@Valid BrandExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = brandService.getBrandList(exportReqVO); + // 导出 Excel + List datas = BrandConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "品牌.xls", "数据", BrandExcelVO.class, datas); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandBaseVO.java new file mode 100644 index 000000000..57c5a390c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandBaseVO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 品牌 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class BrandBaseVO { + + @ApiModelProperty(value = "分类编号", required = true, example = "1") + @NotNull(message = "分类编号不能为空") + private Long categoryId; + + @ApiModelProperty(value = "品牌名称", required = true, example = "芋道") + @NotNull(message = "品牌名称不能为空") + private String name; + + @ApiModelProperty(value = "品牌图片", required = true) + @NotNull(message = "品牌图片不能为空") + private String bannerUrl; + + @ApiModelProperty(value = "品牌排序", example = "1") + private Integer sort; + + @ApiModelProperty(value = "品牌描述", example = "描述") + private String description; + + @ApiModelProperty(value = "状态", required = true, example = "0") + @NotNull(message = "状态不能为空") + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandCreateReqVO.java new file mode 100644 index 000000000..3a6f844fb --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 品牌创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BrandCreateReqVO extends BrandBaseVO { + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExcelVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExcelVO.java new file mode 100644 index 000000000..261b69ea5 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExcelVO.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +import com.alibaba.excel.annotation.ExcelProperty; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + + +/** + * 品牌 Excel VO + * + * @author 芋道源码 + */ +@Data +public class BrandExcelVO { + + @ExcelProperty("品牌编号") + private Long id; + + @ExcelProperty("分类编号") + private Long categoryId; + + @ExcelProperty("品牌名称") + private String name; + + @ExcelProperty("品牌图片") + private String bannerUrl; + + @ExcelProperty("品牌排序") + private Integer sort; + + @ExcelProperty("品牌描述") + private String description; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private Integer status; + + @ExcelProperty("创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExportReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExportReqVO.java new file mode 100644 index 000000000..5fd90d7af --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandExportReqVO.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "管理后台 - 品牌 Excel 导出 Request VO", description = "参数和 BrandPageReqVO 是一致的") +@Data +public class BrandExportReqVO { + + @ApiModelProperty(value = "分类编号", example = "1") + private Long categoryId; + + @ApiModelProperty(value = "品牌名称", example = "芋道") + private String name; + + @ApiModelProperty(value = "状态", example = "0") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandPageReqVO.java new file mode 100644 index 000000000..e4614eeb5 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandPageReqVO.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 品牌分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BrandPageReqVO extends PageParam { + + @ApiModelProperty(value = "分类编号", example = "1") + private Long categoryId; + + @ApiModelProperty(value = "品牌名称", example = "芋道") + private String name; + + @ApiModelProperty(value = "状态", example = "0") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandRespVO.java new file mode 100644 index 000000000..5e010b4d0 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 品牌 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BrandRespVO extends BrandBaseVO { + + @ApiModelProperty(value = "品牌编号", required = true, example = "1") + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandUpdateReqVO.java new file mode 100644 index 000000000..287157f0e --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/BrandUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.product.controller.admin.brand.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 品牌更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BrandUpdateReqVO extends BrandBaseVO { + + @ApiModelProperty(value = "品牌编号", required = true, example = "1") + @NotNull(message = "品牌编号不能为空") + private Long id; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/CategoryController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/CategoryController.java new file mode 100644 index 000000000..12408ac28 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/CategoryController.java @@ -0,0 +1,92 @@ +package cn.iocoder.yudao.module.product.controller.admin.category; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.*; +import cn.iocoder.yudao.module.product.convert.category.CategoryConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; +import cn.iocoder.yudao.module.product.service.category.CategoryService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Comparator; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Api(tags = "管理后台 - 商品分类") +@RestController +@RequestMapping("/product/category") +@Validated +public class CategoryController { + + @Resource + private CategoryService categoryService; + + @PostMapping("/create") + @ApiOperation("创建商品分类") + @PreAuthorize("@ss.hasPermission('product:category:create')") + public CommonResult createCategory(@Valid @RequestBody CategoryCreateReqVO createReqVO) { + return success(categoryService.createCategory(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新商品分类") + @PreAuthorize("@ss.hasPermission('product:category:update')") + public CommonResult updateCategory(@Valid @RequestBody CategoryUpdateReqVO updateReqVO) { + categoryService.updateCategory(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除商品分类") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:category:delete')") + public CommonResult deleteCategory(@RequestParam("id") Long id) { + categoryService.deleteCategory(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得商品分类") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:category:query')") + public CommonResult getCategory(@RequestParam("id") Long id) { + CategoryDO category = categoryService.getCategory(id); + return success(CategoryConvert.INSTANCE.convert(category)); + } + + // TODO @JeromeSoar:这应该是个 app 的接口,提供商品分类的树结构。这个调整下,后端只返回列表,前端构建 tree。注意,不需要返回创建时间、是否开启等无关字段。 + // TODO @YunaiV: 这个是在管理端展示了一个类似菜单的分类树列表, treeListReqVO 只是查询参数的封装命名,返给前端的是列表数据。PS: 这里 /page 接口没有使用到。 + @GetMapping("/listByQuery") + @ApiOperation("获得商品分类列表") + @PreAuthorize("@ss.hasPermission('product:category:query')") + public CommonResult> listByQuery(@Valid CategoryTreeListReqVO treeListReqVO) { + List list = categoryService.getCategoryTreeList(treeListReqVO); + list.sort(Comparator.comparing(CategoryDO::getSort)); + return success(CategoryConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出商品分类 Excel") + @PreAuthorize("@ss.hasPermission('product:category:export')") + @OperateLog(type = EXPORT) + public void exportCategoryExcel(@Valid CategoryExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = categoryService.getCategoryList(exportReqVO); + // 导出 Excel + List datas = CategoryConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "商品分类.xls", "数据", CategoryExcelVO.class, datas); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryBaseVO.java new file mode 100644 index 000000000..598e093eb --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryBaseVO.java @@ -0,0 +1,42 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** +* 商品分类 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class CategoryBaseVO { + + @ApiModelProperty(value = "父分类编号", required = true, example = "1") + @NotNull(message = "父分类编号不能为空") + private Long parentId; + + @ApiModelProperty(value = "分类名称", required = true, example = "办公文具") + @NotBlank(message = "分类名称不能为空") + private String name; + + @ApiModelProperty(value = "分类图标") + @NotBlank(message = "分类图标不能为空") + private String icon; + + @ApiModelProperty(value = "分类图片", required = true) + @NotBlank(message = "分类图片不能为空") + private String bannerUrl; + + @ApiModelProperty(value = "分类排序", required = true, example = "1") + private Integer sort; + + @ApiModelProperty(value = "分类描述", required = true, example = "描述") + private String description; + + @ApiModelProperty(value = "开启状态", required = true, example = "0") + @NotNull(message = "开启状态不能为空") + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryCreateReqVO.java new file mode 100644 index 000000000..ce583f08b --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 商品分类创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CategoryCreateReqVO extends CategoryBaseVO { + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExcelVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExcelVO.java new file mode 100644 index 000000000..f8e36ee8c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExcelVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.util.Date; + + +/** + * 商品分类 Excel VO + * + * @author 芋道源码 + */ +@Data +public class CategoryExcelVO { + + @ExcelProperty("分类编号") + private Long id; + + @ExcelProperty("父分类编号") + private Long parentId; + + @ExcelProperty("分类名称") + private String name; + + @ExcelProperty("分类图标") + private String icon; + + @ExcelProperty("分类图片") + private String bannerUrl; + + @ExcelProperty("分类排序") + private Integer sort; + + @ExcelProperty("分类描述") + private String description; + + @ExcelProperty(value = "开启状态", converter = DictConvert.class) + @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private Integer status; + + @ExcelProperty("创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExportReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExportReqVO.java new file mode 100644 index 000000000..c1e23b3ed --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryExportReqVO.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "管理后台 - 商品分类 Excel 导出 Request VO", description = "参数和 CategoryPageReqVO 是一致的") +@Data +public class CategoryExportReqVO { + + @ApiModelProperty(value = "分类名称", example = "办公文具") + private String name; + + @ApiModelProperty(value = "开启状态", example = "0") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryPageReqVO.java new file mode 100644 index 000000000..d824b8bd8 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryPageReqVO.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 商品分类分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CategoryPageReqVO extends PageParam { + + @ApiModelProperty(value = "分类名称", example = "办公文具") + private String name; + + @ApiModelProperty(value = "开启状态", example = "0") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryRespVO.java new file mode 100644 index 000000000..e7d0b2238 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 商品分类 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CategoryRespVO extends CategoryBaseVO { + + @ApiModelProperty(value = "分类编号", required = true, example = "2") + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryTreeListReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryTreeListReqVO.java new file mode 100644 index 000000000..12256efd3 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryTreeListReqVO.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Data +@ApiModel(value = "管理后台 - 商品分类列表查询 Request VO", description = "参数和 CategoryPageReqVO 是一致的") +public class CategoryTreeListReqVO extends CategoryExportReqVO { + + @ApiModelProperty(value = "分类名称", example = "办公文具") + private String name; + + @ApiModelProperty(value = "开启状态", example = "0") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryUpdateReqVO.java new file mode 100644 index 000000000..13ee83c1e --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/CategoryUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.product.controller.admin.category.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 商品分类更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CategoryUpdateReqVO extends CategoryBaseVO { + + @ApiModelProperty(value = "分类编号", required = true, example = "2") + @NotNull(message = "分类编号不能为空") + private Long id; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java new file mode 100644 index 000000000..f1d31acab --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java @@ -0,0 +1,97 @@ +package cn.iocoder.yudao.module.product.controller.admin.property; + +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.annotations.*; + +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; +import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; +import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; + +@Api(tags = "管理后台 - 规格名称") +@RestController +@RequestMapping("/product/property") +@Validated +public class ProductPropertyController { + + @Resource + private ProductPropertyService productPropertyService; + + @PostMapping("/create") + @ApiOperation("创建规格名称") + @PreAuthorize("@ss.hasPermission('product:property:create')") + public CommonResult createProperty(@Valid @RequestBody ProductPropertyCreateReqVO createReqVO) { + return success(productPropertyService.createProperty(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新规格名称") + @PreAuthorize("@ss.hasPermission('product:property:update')") + public CommonResult updateProperty(@Valid @RequestBody ProductPropertyUpdateReqVO updateReqVO) { + productPropertyService.updateProperty(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除规格名称") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:property:delete')") + public CommonResult deleteProperty(@RequestParam("id") Long id) { + productPropertyService.deleteProperty(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得规格名称") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:property:query')") + public CommonResult getProperty(@RequestParam("id") Long id) { + return success(productPropertyService.getPropertyResp(id)); + } + + @GetMapping("/list") + @ApiOperation("获得规格名称列表") + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @PreAuthorize("@ss.hasPermission('product:property:query')") + public CommonResult> getPropertyList(@RequestParam("ids") Collection ids) { + List list = productPropertyService.getPropertyList(ids); + return success(ProductPropertyConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("获得规格名称分页") + @PreAuthorize("@ss.hasPermission('product:property:query')") + public CommonResult> getPropertyPage(@Valid ProductPropertyPageReqVO pageVO) { + return success(productPropertyService.getPropertyListPage(pageVO)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出规格名称 Excel") + @PreAuthorize("@ss.hasPermission('product:property:export')") + @OperateLog(type = EXPORT) + public void exportPropertyExcel(@Valid ProductPropertyExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = productPropertyService.getPropertyList(exportReqVO); + // 导出 Excel + List datas = ProductPropertyConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "规格名称.xls", "数据", ProductPropertyExcelVO.class, datas); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyBaseVO.java new file mode 100644 index 000000000..4d38763f9 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyBaseVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 规格名称 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ProductPropertyBaseVO { + + @ApiModelProperty(value = "规格名称") + private String name; + + @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java new file mode 100644 index 000000000..54d72da8a --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; +import lombok.*; +import io.swagger.annotations.*; + +import javax.validation.constraints.NotNull; +import java.util.List; + +@ApiModel("管理后台 - 规格名称创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyCreateReqVO extends ProductPropertyBaseVO { + + @ApiModelProperty(value = "属性值") + @NotNull(message = "属性值不能为空") + List propertyValueList; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExcelVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExcelVO.java new file mode 100644 index 000000000..c935c1001 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExcelVO.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 规格名称 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ProductPropertyExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty("规格名称") + private String name; + + @ExcelProperty("状态: 0 开启 ,1 禁用") + private Integer status; + + @ExcelProperty("创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExportReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExportReqVO.java new file mode 100644 index 000000000..e19ea2bfa --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExportReqVO.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 PropertyPageReqVO 是一致的") +@Data +public class ProductPropertyExportReqVO { + + @ApiModelProperty(value = "规格名称") + private String name; + + @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyPageReqVO.java new file mode 100644 index 000000000..34d7239f2 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyPageReqVO.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 规格名称分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyPageReqVO extends PageParam { + + @ApiModelProperty(value = "规格名称") + private String name; + + @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyRespVO.java new file mode 100644 index 000000000..978f26308 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyRespVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 规格名称 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyRespVO extends ProductPropertyBaseVO { + + @ApiModelProperty(value = "主键", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "属性值") + private List propertyValueList; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java new file mode 100644 index 000000000..ed190e8b0 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.product.controller.admin.property.vo; + +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; +import lombok.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; +import java.util.List; + +@ApiModel("管理后台 - 规格名称更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { + + @ApiModelProperty(value = "主键", required = true) + @NotNull(message = "主键不能为空") + private Long id; + + @ApiModelProperty(value = "属性值") + @NotNull(message = "属性值不能为空") + List propertyValueList; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueBaseVO.java new file mode 100644 index 000000000..ed600a9ac --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueBaseVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 规格值 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ProductPropertyValueBaseVO { + + @ApiModelProperty(value = "规格键id") + private Long propertyId; + + @ApiModelProperty(value = "规格值名字") + private String name; + + @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueCreateReqVO.java new file mode 100644 index 000000000..23ea0690c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueCreateReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; + +import lombok.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 规格值创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyValueCreateReqVO extends ProductPropertyValueBaseVO { + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueRespVO.java new file mode 100644 index 000000000..25fa25f02 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 规格值 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO { + + @ApiModelProperty(value = "主键", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueUpdateReqVO.java new file mode 100644 index 000000000..894d6f6eb --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueUpdateReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; + +import lombok.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 规格值更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO { + + @ApiModelProperty(value = "主键", required = true) + @NotNull(message = "主键不能为空") + private Integer id; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java new file mode 100755 index 000000000..132d68d94 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java @@ -0,0 +1,99 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.*; +import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Api(tags = "管理后台 - 商品 sku") +@RestController +@RequestMapping("/product/sku") +@Validated +public class ProductSkuController { + + @Resource + private ProductSkuService ProductSkuService; + + @PostMapping("/create") + @ApiOperation("创建商品sku") + @PreAuthorize("@ss.hasPermission('product:sku:create')") + public CommonResult createSku(@Valid @RequestBody ProductSkuCreateReqVO createReqVO) { + return success(ProductSkuService.createSku(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新商品sku") + @PreAuthorize("@ss.hasPermission('product:sku:update')") + public CommonResult updateSku(@Valid @RequestBody ProductSkuUpdateReqVO updateReqVO) { + ProductSkuService.updateSku(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除商品sku") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:sku:delete')") + public CommonResult deleteSku(@RequestParam("id") Long id) { + ProductSkuService.deleteSku(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得商品sku") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:sku:query')") + public CommonResult getSku(@RequestParam("id") Long id) { + ProductSkuDO sku = ProductSkuService.getSku(id); + return success(ProductSkuConvert.INSTANCE.convert(sku)); + } + + @GetMapping("/list") + @ApiOperation("获得商品sku列表") + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @PreAuthorize("@ss.hasPermission('product:sku:query')") + public CommonResult> getSkuList(@RequestParam("ids") Collection ids) { + List list = ProductSkuService.getSkuList(ids); + return success(ProductSkuConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("获得商品sku分页") + @PreAuthorize("@ss.hasPermission('product:sku:query')") + public CommonResult> getSkuPage(@Valid ProductSkuPageReqVO pageVO) { + PageResult pageResult = ProductSkuService.getSkuPage(pageVO); + return success(ProductSkuConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出商品sku Excel") + @PreAuthorize("@ss.hasPermission('product:sku:export')") + @OperateLog(type = EXPORT) + public void exportSkuExcel(@Valid ProductSkuExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = ProductSkuService.getSkuList(exportReqVO); + // 导出 Excel + List datas = ProductSkuConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "商品sku.xls", "数据", ProductSkuExcelVO.class, datas); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java new file mode 100755 index 000000000..cefab9a47 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java @@ -0,0 +1,58 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 商品sku Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ProductSkuBaseVO { + + // TODO @franky:example 要写哈; + + @ApiModelProperty(value = "spu编号") + private Long spuId; + + // TODO @franky:类似这种字段,有额外说明的。可以写成; @ApiModelProperty(value = "规格值数组", required = true, notes = "json格式, [{propertyId: , valueId: }, {propertyId: , valueId: }]") + + @ApiModelProperty(value = "规格值数组-json格式, [{propertyId: , valueId: }, {propertyId: , valueId: }]", required = true) + @NotNull(message = "规格值数组-json格式, [{propertyId: , valueId: }, {propertyId: , valueId: }]不能为空") + private List properties; + + @ApiModelProperty(value = "销售价格,单位:分", required = true) + @NotNull(message = "销售价格,单位:分不能为空") + private Integer price; + + @ApiModelProperty(value = "原价, 单位: 分", required = true) + @NotNull(message = "原价, 单位: 分不能为空") + private Integer originalPrice; + + @ApiModelProperty(value = "成本价,单位: 分", required = true) + @NotNull(message = "成本价,单位: 分不能为空") + private Integer costPrice; + + @ApiModelProperty(value = "条形码", required = true) + @NotNull(message = "条形码不能为空") + private String barCode; + + @ApiModelProperty(value = "图片地址", required = true) + @NotNull(message = "图片地址不能为空") + private String picUrl; + + @ApiModelProperty(value = "状态: 0-正常 1-禁用") + private Integer status; + + // TODO @franky 要有 swagger 注解 + @Data + public static class Property { + @NotNull(message = "规格属性名id不能为空") + private Long propertyId; + @NotNull(message = "规格属性值id不能为空") + private Long valueId; + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateReqVO.java new file mode 100755 index 000000000..e01c272a4 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 商品sku创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductSkuCreateReqVO extends ProductSkuBaseVO { + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExcelVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExcelVO.java new file mode 100755 index 000000000..7caf1313d --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExcelVO.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 商品sku Excel VO + * + * @author 芋道源码 + */ +@Data +public class ProductSkuExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty("spu编号") + private Long spuId; + + // TODO @franky:这个单元格,可能会有点展示的问题 + @ExcelProperty("规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") + private List properties; + + @ExcelProperty("销售价格,单位:分") + private Integer price; + + @ExcelProperty("原价, 单位: 分") + private Integer originalPrice; + + @ExcelProperty("成本价,单位: 分") + private Integer costPrice; + + @ExcelProperty("条形码") + private String barCode; + + @ExcelProperty("图片地址") + private String picUrl; + + @ExcelProperty("状态: 0-正常 1-禁用") + private Integer status; + + @ExcelProperty("创建时间") + private Date createTime; + + @Data + public static class Property { + private Integer propertyId; + private Integer valueId; + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExportReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExportReqVO.java new file mode 100755 index 000000000..76847a28f --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuExportReqVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "管理后台 - 商品sku Excel 导出 Request VO", description = "参数和 SkuPageReqVO 是一致的") +@Data +public class ProductSkuExportReqVO { + + @ApiModelProperty(value = "spu编号") + private Long spuId; + + @ApiModelProperty(value = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") + private String properties; + + @ApiModelProperty(value = "销售价格,单位:分") + private Integer price; + + @ApiModelProperty(value = "原价, 单位: 分") + private Integer originalPrice; + + @ApiModelProperty(value = "成本价,单位: 分") + private Integer costPrice; + + @ApiModelProperty(value = "条形码") + private String barCode; + + @ApiModelProperty(value = "图片地址") + private String picUrl; + + @ApiModelProperty(value = "状态: 0-正常 1-禁用") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuPageReqVO.java new file mode 100755 index 000000000..fcf8b95fc --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuPageReqVO.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 商品sku分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductSkuPageReqVO extends PageParam { + + @ApiModelProperty(value = "spu编号") + private Long spuId; + + @ApiModelProperty(value = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") + private String properties; + + @ApiModelProperty(value = "销售价格,单位:分") + private Integer price; + + @ApiModelProperty(value = "原价, 单位: 分") + private Integer originalPrice; + + @ApiModelProperty(value = "成本价,单位: 分") + private Integer costPrice; + + @ApiModelProperty(value = "条形码") + private String barCode; + + @ApiModelProperty(value = "图片地址") + private String picUrl; + + @ApiModelProperty(value = "状态: 0-正常 1-禁用") + private Integer status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java new file mode 100755 index 000000000..3b12ba21c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("管理后台 - 商品sku Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductSkuRespVO extends ProductSkuBaseVO { + + @ApiModelProperty(value = "主键", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuUpdateReqVO.java new file mode 100755 index 000000000..984976eee --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.product.controller.admin.sku.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 商品sku更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductSkuUpdateReqVO extends ProductSkuBaseVO { + + @ApiModelProperty(value = "主键", required = true) + @NotNull(message = "主键不能为空") + private Long id; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java new file mode 100755 index 000000000..71bfa82bd --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java @@ -0,0 +1,98 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; +import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Api(tags = "管理后台 - 商品spu") +@RestController +@RequestMapping("/product/spu") +@Validated +public class ProductSpuController { + + @Resource + private ProductSpuService spuService; + + @PostMapping("/create") + @ApiOperation("创建商品spu") + @PreAuthorize("@ss.hasPermission('product:spu:create')") + public CommonResult createSpu(@Valid @RequestBody ProductSpuCreateReqVO createReqVO) { + return success(spuService.createSpu(createReqVO)); + } + + // TODO @franky:SpuUpdateReqVO 缺少前缀 + @PutMapping("/update") + @ApiOperation("更新商品spu") + @PreAuthorize("@ss.hasPermission('product:spu:update')") + public CommonResult updateSpu(@Valid @RequestBody SpuUpdateReqVO updateReqVO) { + spuService.updateSpu(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除商品spu") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:spu:delete')") + public CommonResult deleteSpu(@RequestParam("id") Long id) { + spuService.deleteSpu(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得商品spu") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:spu:query')") + public CommonResult getSpu(@RequestParam("id") Long id) { + return success(spuService.getSpu(id)); + } + + @GetMapping("/list") + @ApiOperation("获得商品spu列表") + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('product:spu:query')") + public CommonResult> getSpuList(@RequestParam("ids") Collection ids) { + List list = spuService.getSpuList(ids); + return success(ProductSpuConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("获得商品spu分页") + @PreAuthorize("@ss.hasPermission('product:spu:query')") + public CommonResult> getSpuPage(@Valid SpuPageReqVO pageVO) { + return success(spuService.getSpuPage(pageVO)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出商品spu Excel") + @PreAuthorize("@ss.hasPermission('product:spu:export')") + @OperateLog(type = EXPORT) + public void exportSpuExcel(@Valid SpuExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = spuService.getSpuList(exportReqVO); + // 导出 Excel + List datas = ProductSpuConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "商品spu.xls", "数据", SpuExcelVO.class, datas); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java new file mode 100755 index 000000000..65a5f2a0e --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 商品spu Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ProductSpuBaseVO { + + @ApiModelProperty(value = "商品名称") + private String name; + + @ApiModelProperty(value = "卖点", required = true) + @NotNull(message = "卖点不能为空") + private String sellPoint; + + @ApiModelProperty(value = "描述", required = true) + @NotNull(message = "描述不能为空") + private String description; + + @ApiModelProperty(value = "分类id", required = true) + @NotNull(message = "分类id不能为空") + private Long categoryId; + + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张", required = true) + @NotNull(message = "商品主图地址,* 数组,以逗号分隔,最多上传15张不能为空") + private List picUrls; + + @ApiModelProperty(value = "排序字段", required = true) + @NotNull(message = "排序字段不能为空") + private Integer sort; + + @ApiModelProperty(value = "点赞初始人数") + private Integer likeCount; + + @ApiModelProperty(value = "价格 单位使用:分") + private Integer price; + + @ApiModelProperty(value = "库存数量") + private Integer quantity; + + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") + private Boolean status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java new file mode 100755 index 000000000..6281e20d5 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateReqVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.Valid; +import java.util.List; + +@ApiModel("管理后台 - 商品spu创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProductSpuCreateReqVO extends ProductSpuBaseVO { + + @ApiModelProperty(value = "sku组合") + @Valid + List skus; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExcelVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExcelVO.java new file mode 100755 index 000000000..9e90acd3d --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExcelVO.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 商品spu Excel VO + * + * @author 芋道源码 + */ +@Data +public class SpuExcelVO { + + @ExcelProperty("主键") + private Integer id; + + @ExcelProperty("商品名称") + private String name; + + @ExcelProperty("卖点") + private String sellPoint; + + @ExcelProperty("描述") + private String description; + + @ExcelProperty("分类id") + private Long categoryId; + + @ExcelProperty("商品主图地址,* 数组,以逗号分隔,最多上传15张") + private List picUrls; + + @ExcelProperty("排序字段") + private Integer sort; + + @ExcelProperty("点赞初始人数") + private Integer likeCount; + + @ExcelProperty("价格 单位使用:分") + private Integer price; + + @ExcelProperty("库存数量") + private Integer quantity; + + @ExcelProperty("上下架状态: 0 上架(开启) 1 下架(禁用)") + private Boolean status; + + @ExcelProperty("创建时间") + private Date createTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExportReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExportReqVO.java new file mode 100755 index 000000000..c5658a67e --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExportReqVO.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "管理后台 - 商品spu Excel 导出 Request VO", description = "参数和 SpuPageReqVO 是一致的") +@Data +public class SpuExportReqVO { + + @ApiModelProperty(value = "商品名称") + private String name; + + @ApiModelProperty(value = "卖点") + private String sellPoint; + + @ApiModelProperty(value = "描述") + private String description; + + @ApiModelProperty(value = "分类id") + private Long categoryId; + + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张") + private List picUrls; + + @ApiModelProperty(value = "排序字段") + private Integer sort; + + @ApiModelProperty(value = "点赞初始人数") + private Integer likeCount; + + @ApiModelProperty(value = "价格 单位使用:分") + private Integer price; + + @ApiModelProperty(value = "库存数量") + private Integer quantity; + + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") + private Boolean status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuPageReqVO.java new file mode 100755 index 000000000..59337a242 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuPageReqVO.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 商品spu分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class SpuPageReqVO extends PageParam { + + @ApiModelProperty(value = "商品名称") + private String name; + + @ApiModelProperty(value = "卖点") + private String sellPoint; + + @ApiModelProperty(value = "描述") + private String description; + + @ApiModelProperty(value = "分类id") + private Long categoryId; + + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张") + private String picUrls; + + @ApiModelProperty(value = "排序字段") + private Integer sort; + + @ApiModelProperty(value = "点赞初始人数") + private Integer likeCount; + + @ApiModelProperty(value = "价格 单位使用:分") + private Integer price; + + @ApiModelProperty(value = "库存数量") + private Integer quantity; + + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") + private Boolean status; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuRespVO.java new file mode 100755 index 000000000..90387f90a --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuRespVO.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuRespVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +@ApiModel("管理后台 - 商品spu Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class SpuRespVO extends ProductSpuBaseVO { + + // TODO @franky:注解要完整 + + @ApiModelProperty(value = "主键", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + /** + * SKU 数组 + */ + List skus; + + @ApiModelProperty(value = "分类id数组,一直递归到一级父节点", example = "[1,2,4]") + LinkedList categoryIds; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuUpdateReqVO.java new file mode 100755 index 000000000..9e4092235 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuUpdateReqVO.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.product.controller.admin.spu.vo; + +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateReqVO; +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +import javax.validation.Valid; +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 商品spu更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class SpuUpdateReqVO extends ProductSpuBaseVO { + + @ApiModelProperty(value = "主键", required = true) + @NotNull(message = "主键不能为空") + private Long id; + + @ApiModelProperty(value = "sku组合") + @Valid + List skus; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/brand/BrandConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/brand/BrandConvert.java new file mode 100644 index 000000000..316515603 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/brand/BrandConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.product.convert.brand; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; + +/** + * 品牌 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface BrandConvert { + + BrandConvert INSTANCE = Mappers.getMapper(BrandConvert.class); + + BrandDO convert(BrandCreateReqVO bean); + + BrandDO convert(BrandUpdateReqVO bean); + + BrandRespVO convert(BrandDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/category/CategoryConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/category/CategoryConvert.java new file mode 100644 index 000000000..2b2cfe99c --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/category/CategoryConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.product.convert.category; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; + +/** + * 商品分类 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface CategoryConvert { + + CategoryConvert INSTANCE = Mappers.getMapper(CategoryConvert.class); + + CategoryDO convert(CategoryCreateReqVO bean); + + CategoryDO convert(CategoryUpdateReqVO bean); + + CategoryRespVO convert(CategoryDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java new file mode 100644 index 000000000..c44cdc841 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.product.convert.property; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; + +/** + * 规格名称 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ProductPropertyConvert { + + ProductPropertyConvert INSTANCE = Mappers.getMapper(ProductPropertyConvert.class); + + ProductPropertyDO convert(ProductPropertyCreateReqVO bean); + + ProductPropertyDO convert(ProductPropertyUpdateReqVO bean); + + ProductPropertyRespVO convert(ProductPropertyDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/ProductPropertyValueConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/ProductPropertyValueConvert.java new file mode 100644 index 000000000..447b9a5ea --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/ProductPropertyValueConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.product.convert.propertyvalue; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; + +/** + * 规格值 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ProductPropertyValueConvert { + + ProductPropertyValueConvert INSTANCE = Mappers.getMapper(ProductPropertyValueConvert.class); + + ProductPropertyValueDO convert(ProductPropertyValueCreateReqVO bean); + + ProductPropertyValueDO convert(ProductPropertyValueUpdateReqVO bean); + + ProductPropertyValueRespVO convert(ProductPropertyValueDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList03(List list); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java new file mode 100755 index 000000000..232ce3178 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.product.convert.sku; + +import java.util.*; + +import cn.hutool.json.JSONUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.Named; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import org.springframework.util.StringUtils; + +/** + * 商品sku Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ProductSkuConvert { + + ProductSkuConvert INSTANCE = Mappers.getMapper(ProductSkuConvert.class); + + @Mapping(source = "properties", target = "properties", qualifiedByName = "translateStringFromList") + ProductSkuDO convert(ProductSkuCreateReqVO bean); + + @Mapping(source = "properties", target = "properties", qualifiedByName = "translateStringFromList") + ProductSkuDO convert(ProductSkuUpdateReqVO bean); + + @Mapping(source = "properties", target = "properties", qualifiedByName = "tokenizeToBeanArray") + ProductSkuRespVO convert(ProductSkuDO bean); + + @Mapping(source = "properties", target = "properties", qualifiedByName = "tokenizeToExcelBeanArray") + ProductSkuExcelVO convertToExcelVO(ProductSkuDO bean); + + List convertList(List list); + + List convertSkuDOList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + + @Named("tokenizeToBeanArray") + default List translatePropertyArrayFromString(String properties) { + return JSONUtil.toList(properties, ProductSkuBaseVO.Property.class); + } + + @Named("tokenizeToExcelBeanArray") + default List translateExcelPropertyArrayFromString(String properties) { + return JSONUtil.toList(properties, ProductSkuExcelVO.Property.class); + } + + @Named("translateStringFromList") + default String translatePropertyStringFromList(List properties) { + return JSONUtil.toJsonStr(properties); + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/spu/ProductSpuConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/spu/ProductSpuConvert.java new file mode 100755 index 000000000..92efaf0e8 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/spu/ProductSpuConvert.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.product.convert.spu; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.Named; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import org.springframework.util.StringUtils; + +/** + * 商品spu Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ProductSpuConvert { + + ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class); + + @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromStringList") + ProductSpuDO convert(ProductSpuCreateReqVO bean); + + @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromStringList") + ProductSpuDO convert(SpuUpdateReqVO bean); + + @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "tokenizeToStringArray") + SpuRespVO convert(ProductSpuDO bean); + + @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "tokenizeToStringArray") + SpuExcelVO convertToExcelVO(ProductSpuDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + + @Named("tokenizeToStringArray") + default List translatePicUrlsArrayFromString(String picUrls) { + return Arrays.asList(StringUtils.tokenizeToStringArray(picUrls, ",")); + } + + @Named("translatePicUrlsFromStringList") + default String translatePicUrlsFromList(List picUrls) { + return StringUtils.collectionToCommaDelimitedString(picUrls); + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/brand/BrandDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/brand/BrandDO.java new file mode 100644 index 000000000..2cbcee877 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/brand/BrandDO.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.brand; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +// TODO @JeromeSoar:Product 前缀 +/** + * 品牌 DO + * + * @author 芋道源码 + */ +@TableName("product_brand") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BrandDO extends BaseDO { + + /** + * 品牌编号 + */ + @TableId + private Long id; + /** + * 分类编号 + */ + private Long categoryId; + /** + * 品牌名称 + */ + private String name; + /** + * 品牌图片 + */ + private String bannerUrl; + /** + * 品牌排序 + */ + private Integer sort; + /** + * 品牌描述 + */ + private String description; + /** + * 状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/CategoryDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/CategoryDO.java new file mode 100644 index 000000000..c6eb655ab --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/CategoryDO.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.category; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +// TODO @JeromeSoar:Product 前缀 +/** + * 商品分类 DO + * + * @author 芋道源码 + */ +@TableName("product_category") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CategoryDO extends BaseDO { + + /** + * 分类编号 + */ + @TableId + private Long id; + /** + * 父分类编号 + */ + private Long parentId; + /** + * 分类名称 + */ + private String name; + /** + * 分类图标 + */ + private String icon; + /** + * 分类 Banner 图片 + * + * 第一层的商品分类,会有该字段,用于用户 App 展示 + */ + private String bannerUrl; + /** + * 分类排序 + */ + private Integer sort; + /** + * 分类描述 + */ + private String description; + /** + * 开启状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java new file mode 100644 index 000000000..5255c36ed --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.property; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 规格名称 DO + * + * @author 芋道源码 + */ +@TableName("product_property") +@KeySequence("product_property_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProductPropertyDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 规格名称 + */ + private String name; + /** + * 状态: 0 开启 ,1 禁用 + * + * {@link CommonStatusEnum} + */ + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyValueDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyValueDO.java new file mode 100644 index 000000000..0203939cc --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyValueDO.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.property; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + + +/** + * 规格值 DO + * + * @author 芋道源码 + */ +@TableName("product_property_value") +@KeySequence("product_property_value_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProductPropertyValueDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 规格键 id + * + * TODO @franky:加个 关联 {@link ProductPropertyDO#getId()} ,这样就能更好的知道 + */ + private Long propertyId; + /** + * 规格值名字 + */ + private String name; + /** + * 状态: 1 开启 ,2 禁用 + */ + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/sku/ProductSkuDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/sku/ProductSkuDO.java new file mode 100755 index 000000000..1ffaaeef2 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/sku/ProductSkuDO.java @@ -0,0 +1,64 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.sku; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 商品sku DO + * + * @author 芋道源码 + */ +@TableName("product_sku") +@KeySequence("product_sku_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProductSkuDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * spu编号 + */ + private Long spuId; + /** + * 规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }] + */ + // TODO franky:可以定义一个内部的 Property 类,然后 List + private String properties; + /** + * 销售价格,单位:分 + */ + private Integer price; + /** + * 原价,单位:分 + */ + private Integer originalPrice; + /** + * 成本价,单位: 分 + */ + private Integer costPrice; + /** + * 条形码 + */ + private String barCode; + /** + * 图片地址 + */ + private String picUrl; + /** + * 状态: 0-正常 1-禁用 + */ + private Integer status; + +} + diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java new file mode 100755 index 000000000..2da638077 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.product.dal.dataobject.spu; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 商品spu DO + * + * @author 芋道源码 + */ +@TableName("product_spu") +@KeySequence("product_spu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProductSpuDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 商品名称 + */ + private String name; + /** + * 卖点 + */ + private String sellPoint; + /** + * 描述 + */ + private String description; + /** + * 分类id + */ + private Long categoryId; + /** + * 商品主图地址,* 数组,以逗号分隔,最多上传15张 + */ + // TODO franky:List。可以参考别的模块,怎么处理这种类型的哈 + private String picUrls; + /** + * 排序字段 + */ + private Integer sort; + /** + * 点赞初始人数 + */ + private Integer likeCount; + /** + * 价格 单位使用:分 + */ + private Integer price; + /** + * 库存数量 + */ + private Integer quantity; + /** + * 上下架状态: 0 上架(开启) 1 下架(禁用) + */ + private Boolean status; + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/brand/BrandMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/brand/BrandMapper.java new file mode 100644 index 000000000..84fda1c32 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/brand/BrandMapper.java @@ -0,0 +1,38 @@ +package cn.iocoder.yudao.module.product.dal.mysql.brand; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; + +/** + * 品牌 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface BrandMapper extends BaseMapperX { + + default PageResult selectPage(BrandPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BrandDO::getCategoryId, reqVO.getCategoryId()) + .likeIfPresent(BrandDO::getName, reqVO.getName()) + .eqIfPresent(BrandDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(BrandDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(BrandDO::getId)); + } + + default List selectList(BrandExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BrandDO::getCategoryId, reqVO.getCategoryId()) + .likeIfPresent(BrandDO::getName, reqVO.getName()) + .eqIfPresent(BrandDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(BrandDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(BrandDO::getId)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/category/CategoryMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/category/CategoryMapper.java new file mode 100644 index 000000000..a6ea75b2e --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/category/CategoryMapper.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.product.dal.mysql.category; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryExportReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryPageReqVO; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 商品分类 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface CategoryMapper extends BaseMapperX { + + default PageResult selectPage(CategoryPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(CategoryDO::getName, reqVO.getName()) + .eqIfPresent(CategoryDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(CategoryDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(CategoryDO::getId)); + } + + default List selectList(CategoryExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(CategoryDO::getName, reqVO.getName()) + .eqIfPresent(CategoryDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(CategoryDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(CategoryDO::getId)); + } + + default Long selectCountByParentId(Long parentId) { + return selectCount(CategoryDO::getParentId, parentId); + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyMapper.java new file mode 100644 index 000000000..079b21c84 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyMapper.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.module.product.dal.mysql.property; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; + +/** + * 规格名称 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ProductPropertyMapper extends BaseMapperX { + + default PageResult selectPage(ProductPropertyPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(ProductPropertyDO::getName, reqVO.getName()) + .eqIfPresent(ProductPropertyDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductPropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductPropertyDO::getId)); + } + + default List selectList(ProductPropertyExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(ProductPropertyDO::getName, reqVO.getName()) + .eqIfPresent(ProductPropertyDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductPropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductPropertyDO::getId)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/ProductPropertyValueMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/ProductPropertyValueMapper.java new file mode 100644 index 000000000..5c11a9f42 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/ProductPropertyValueMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.product.dal.mysql.propertyvalue; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 规格值 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ProductPropertyValueMapper extends BaseMapperX { + + // TODO @franky:方法名,selectListByXXX。mapper 的操作都是 crud + default List getPropertyValueListByPropertyId(List propertyIds){ + // TODO @franky:调用父类的 selectList + return selectList(new LambdaQueryWrapperX() + .inIfPresent(ProductPropertyValueDO::getPropertyId, propertyIds)); + } + + default void deletePropertyValueByPropertyId(Long propertyId){ + // TODO @franky:delete(new ) 即可 + LambdaQueryWrapperX queryWrapperX = new LambdaQueryWrapperX<>(); + queryWrapperX.eq(ProductPropertyValueDO::getPropertyId, propertyId) + .eq(ProductPropertyValueDO::getDeleted, false); + delete(queryWrapperX); + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java new file mode 100755 index 000000000..5b856fd96 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.product.dal.mysql.sku; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuExportReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuPageReqVO; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 商品sku Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ProductSkuMapper extends BaseMapperX { + + default PageResult selectPage(ProductSkuPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ProductSkuDO::getSpuId, reqVO.getSpuId()) + .eqIfPresent(ProductSkuDO::getProperties, reqVO.getProperties()) + .eqIfPresent(ProductSkuDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ProductSkuDO::getOriginalPrice, reqVO.getOriginalPrice()) + .eqIfPresent(ProductSkuDO::getCostPrice, reqVO.getCostPrice()) + .eqIfPresent(ProductSkuDO::getBarCode, reqVO.getBarCode()) + .eqIfPresent(ProductSkuDO::getPicUrl, reqVO.getPicUrl()) + .eqIfPresent(ProductSkuDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductSkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductSkuDO::getId)); + } + + default List selectList(ProductSkuExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ProductSkuDO::getSpuId, reqVO.getSpuId()) + .eqIfPresent(ProductSkuDO::getProperties, reqVO.getProperties()) + .eqIfPresent(ProductSkuDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ProductSkuDO::getOriginalPrice, reqVO.getOriginalPrice()) + .eqIfPresent(ProductSkuDO::getCostPrice, reqVO.getCostPrice()) + .eqIfPresent(ProductSkuDO::getBarCode, reqVO.getBarCode()) + .eqIfPresent(ProductSkuDO::getPicUrl, reqVO.getPicUrl()) + .eqIfPresent(ProductSkuDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductSkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductSkuDO::getId)); + } + + // TODO @franky:方法名 selectList; 可以直接调用 selectList + default List selectBySpuIds(List spuIds) { + return selectList(new LambdaQueryWrapperX() + .inIfPresent(ProductSkuDO::getSpuId, spuIds)); + } + + default void deleteBySpuId(Long spuId) { + // TODO @franky:直接 delete(new XXX) 即可,更简洁一些 + LambdaQueryWrapperX lambdaQueryWrapperX = new LambdaQueryWrapperX() + .eqIfPresent(ProductSkuDO::getSpuId, spuId); + delete(lambdaQueryWrapperX); + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java new file mode 100755 index 000000000..d6349eb2f --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.product.dal.mysql.spu; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; + +/** + * 商品spu Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ProductSpuMapper extends BaseMapperX { + + default PageResult selectPage(SpuPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(ProductSpuDO::getName, reqVO.getName()) + .eqIfPresent(ProductSpuDO::getSellPoint, reqVO.getSellPoint()) + .eqIfPresent(ProductSpuDO::getDescription, reqVO.getDescription()) + .eqIfPresent(ProductSpuDO::getCategoryId, reqVO.getCategoryId()) + .eqIfPresent(ProductSpuDO::getPicUrls, reqVO.getPicUrls()) + .eqIfPresent(ProductSpuDO::getSort, reqVO.getSort()) + .eqIfPresent(ProductSpuDO::getLikeCount, reqVO.getLikeCount()) + .eqIfPresent(ProductSpuDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ProductSpuDO::getQuantity, reqVO.getQuantity()) + .eqIfPresent(ProductSpuDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductSpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductSpuDO::getId)); + } + + default List selectList(SpuExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(ProductSpuDO::getName, reqVO.getName()) + .eqIfPresent(ProductSpuDO::getSellPoint, reqVO.getSellPoint()) + .eqIfPresent(ProductSpuDO::getDescription, reqVO.getDescription()) + .eqIfPresent(ProductSpuDO::getCategoryId, reqVO.getCategoryId()) + .eqIfPresent(ProductSpuDO::getPicUrls, reqVO.getPicUrls()) + .eqIfPresent(ProductSpuDO::getSort, reqVO.getSort()) + .eqIfPresent(ProductSpuDO::getLikeCount, reqVO.getLikeCount()) + .eqIfPresent(ProductSpuDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ProductSpuDO::getQuantity, reqVO.getQuantity()) + .eqIfPresent(ProductSpuDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(ProductSpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(ProductSpuDO::getId)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/package-info.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/package-info.java new file mode 100644 index 000000000..4e80cc2bc --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/package-info.java @@ -0,0 +1,7 @@ +/** + * TODO + * + * @author JeromeSoar + * @since 2022-04-24 + */ +package cn.iocoder.yudao.module.product; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandService.java new file mode 100644 index 000000000..2cb356fed --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.product.service.brand; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 品牌 Service 接口 + * + * @author 芋道源码 + */ +public interface BrandService { + + /** + * 创建品牌 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createBrand(@Valid BrandCreateReqVO createReqVO); + + /** + * 更新品牌 + * + * @param updateReqVO 更新信息 + */ + void updateBrand(@Valid BrandUpdateReqVO updateReqVO); + + /** + * 删除品牌 + * + * @param id 编号 + */ + void deleteBrand(Long id); + + /** + * 获得品牌 + * + * @param id 编号 + * @return 品牌 + */ + BrandDO getBrand(Long id); + + /** + * 获得品牌列表 + * + * @param ids 编号 + * @return 品牌列表 + */ + List getBrandList(Collection ids); + + /** + * 获得品牌分页 + * + * @param pageReqVO 分页查询 + * @return 品牌分页 + */ + PageResult getBrandPage(BrandPageReqVO pageReqVO); + + /** + * 获得品牌列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 品牌列表 + */ + List getBrandList(BrandExportReqVO exportReqVO); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImpl.java new file mode 100644 index 000000000..dedda3ae2 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.product.service.brand; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.product.convert.brand.BrandConvert; +import cn.iocoder.yudao.module.product.dal.mysql.brand.BrandMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; + +/** + * 品牌 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class BrandServiceImpl implements BrandService { + + @Resource + private BrandMapper brandMapper; + + @Override + public Long createBrand(BrandCreateReqVO createReqVO) { + // 插入 + BrandDO brand = BrandConvert.INSTANCE.convert(createReqVO); + brandMapper.insert(brand); + // 返回 + return brand.getId(); + } + + @Override + public void updateBrand(BrandUpdateReqVO updateReqVO) { + // 校验存在 + this.validateBrandExists(updateReqVO.getId()); + // 更新 + BrandDO updateObj = BrandConvert.INSTANCE.convert(updateReqVO); + brandMapper.updateById(updateObj); + } + + @Override + public void deleteBrand(Long id) { + // 校验存在 + this.validateBrandExists(id); + // 删除 + brandMapper.deleteById(id); + } + + private void validateBrandExists(Long id) { + if (brandMapper.selectById(id) == null) { + throw exception(BRAND_NOT_EXISTS); + } + } + + @Override + public BrandDO getBrand(Long id) { + return brandMapper.selectById(id); + } + + @Override + public List getBrandList(Collection ids) { + return brandMapper.selectBatchIds(ids); + } + + @Override + public PageResult getBrandPage(BrandPageReqVO pageReqVO) { + return brandMapper.selectPage(pageReqVO); + } + + @Override + public List getBrandList(BrandExportReqVO exportReqVO) { + return brandMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryService.java new file mode 100644 index 000000000..4df2f19f9 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryService.java @@ -0,0 +1,86 @@ +package cn.iocoder.yudao.module.product.service.category; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; + +import javax.validation.Valid; +import java.util.Collection; +import java.util.List; + +// TODO @JeromeSoar:需要 Product 前缀 +/** + * 商品分类 Service 接口 + * + * @author 芋道源码 + */ +public interface CategoryService { + + /** + * 创建商品分类 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createCategory(@Valid CategoryCreateReqVO createReqVO); + + /** + * 更新商品分类 + * + * @param updateReqVO 更新信息 + */ + void updateCategory(@Valid CategoryUpdateReqVO updateReqVO); + + /** + * 删除商品分类 + * + * @param id 编号 + */ + void deleteCategory(Long id); + + /** + * 获得商品分类 + * + * @param id 编号 + * @return 商品分类 + */ + CategoryDO getCategory(Long id); + + /** + * 获得商品分类列表 + * + * @param ids 编号 + * @return 商品分类列表 + */ + List getCategoryList(Collection ids); + + /** + * 获得商品分类分页 + * + * @param pageReqVO 分页查询 + * @return 商品分类分页 + */ + PageResult getCategoryPage(CategoryPageReqVO pageReqVO); + + /** + * 获得商品分类列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 商品分类列表 + */ + List getCategoryList(CategoryExportReqVO exportReqVO); + + /** + * 获得商品分类列表 + * + * @param treeListReqVO 查询条件 + * @return 商品分类列表 + */ + List getCategoryTreeList(CategoryTreeListReqVO treeListReqVO); + + /** + * 验证选择的分类的合法性 + * @param categoryId 分类id + */ + void validatedCategoryById(Long categoryId); +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImpl.java new file mode 100644 index 000000000..3fa441b66 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImpl.java @@ -0,0 +1,109 @@ +package cn.iocoder.yudao.module.product.service.category; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.*; +import cn.iocoder.yudao.module.product.convert.category.CategoryConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; +import cn.iocoder.yudao.module.product.dal.mysql.category.CategoryMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; + +/** + * 商品分类 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class CategoryServiceImpl implements CategoryService { + + @Resource + private CategoryMapper categoryMapper; + + @Override + public Long createCategory(CategoryCreateReqVO createReqVO) { + // 校验父分类存在 + this.validateCategoryExists(createReqVO.getParentId(), CATEGORY_PARENT_NOT_EXISTS); + // 插入 + CategoryDO category = CategoryConvert.INSTANCE.convert(createReqVO); + categoryMapper.insert(category); + // 返回 + return category.getId(); + } + + @Override + public void updateCategory(CategoryUpdateReqVO updateReqVO) { + // 校验父分类存在 + this.validateCategoryExists(updateReqVO.getParentId(), CATEGORY_PARENT_NOT_EXISTS); + // 校验分类是否存在 + this.validateCategoryExists(updateReqVO.getId(), CATEGORY_NOT_EXISTS); + // 更新 + CategoryDO updateObj = CategoryConvert.INSTANCE.convert(updateReqVO); + categoryMapper.updateById(updateObj); + } + + @Override + public void deleteCategory(Long id) { + // TODO 芋艿 补充只有不存在商品才可以删除 + // 校验分类是否存在 + CategoryDO categoryDO = this.validateCategoryExists(id, CATEGORY_NOT_EXISTS); + // 校验是否还有子分类 + if (categoryMapper.selectCountByParentId(categoryDO.getParentId()) > 0) { + throw ServiceExceptionUtil.exception(CATEGORY_EXISTS_CHILDREN); + } + // 删除 + categoryMapper.deleteById(id); + } + + private CategoryDO validateCategoryExists(Long id, ErrorCode errorCode) { + // TODO franky:0 要枚举哈 + if (id == 0) { + return new CategoryDO().setId(id); + } + CategoryDO categoryDO = categoryMapper.selectById(id); + if (categoryDO == null) { + throw exception(errorCode); + } + return categoryDO; + } + + @Override + public void validatedCategoryById(Long categoryId) { + this.validateCategoryExists(categoryId, CATEGORY_NOT_EXISTS); + } + + @Override + public CategoryDO getCategory(Long id) { + return categoryMapper.selectById(id); + } + + @Override + public List getCategoryList(Collection ids) { + return categoryMapper.selectBatchIds(ids); + } + + @Override + public PageResult getCategoryPage(CategoryPageReqVO pageReqVO) { + return categoryMapper.selectPage(pageReqVO); + } + + @Override + public List getCategoryList(CategoryExportReqVO exportReqVO) { + return categoryMapper.selectList(exportReqVO); + } + + @Override + public List getCategoryTreeList(CategoryTreeListReqVO treeListReqVO) { + return categoryMapper.selectList(treeListReqVO); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java new file mode 100644 index 000000000..a663a49ce --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java @@ -0,0 +1,85 @@ +package cn.iocoder.yudao.module.product.service.property; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 规格名称 Service 接口 + * + * @author 芋道源码 + */ +public interface ProductPropertyService { + + /** + * 创建规格名称 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createProperty(@Valid ProductPropertyCreateReqVO createReqVO); + + /** + * 更新规格名称 + * + * @param updateReqVO 更新信息 + */ + void updateProperty(@Valid ProductPropertyUpdateReqVO updateReqVO); + + /** + * 删除规格名称 + * + * @param id 编号 + */ + void deleteProperty(Long id); + + /** + * 获得规格名称 + * + * @param id 编号 + * @return 规格名称 + */ + ProductPropertyDO getProperty(Long id); + + /** + * 获得规格名称列表 + * + * @param ids 编号 + * @return 规格名称列表 + */ + List getPropertyList(Collection ids); + + /** + * 获得规格名称分页 + * + * @param pageReqVO 分页查询 + * @return 规格名称分页 + */ + PageResult getPropertyPage(ProductPropertyPageReqVO pageReqVO); + + /** + * 获得规格名称列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 规格名称列表 + */ + List getPropertyList(ProductPropertyExportReqVO exportReqVO); + + /** + * 获取属性及属性值列表 分页 + * @param pageReqVO + * @return + */ + PageResult getPropertyListPage(ProductPropertyPageReqVO pageReqVO); + + ProductPropertyRespVO getPropertyResp(Long id); + + /** + * 根据数据名id集合查询属性名以及属性值的集合 + * @param propertyIds 属性名id集合 + * @return + */ + List selectByIds(List propertyIds); +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java new file mode 100644 index 000000000..9cb1a0da3 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java @@ -0,0 +1,155 @@ +package cn.iocoder.yudao.module.product.service.property; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; +import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; +import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; +import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyMapper; +import cn.iocoder.yudao.module.product.dal.mysql.propertyvalue.ProductPropertyValueMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_NOT_EXISTS; + +/** + * 规格名称 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ProductPropertyServiceImpl implements ProductPropertyService { + + @Resource + private ProductPropertyMapper productPropertyMapper; + + @Resource + private ProductPropertyValueMapper productPropertyValueMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public Long createProperty(ProductPropertyCreateReqVO createReqVO) { + // 插入 + ProductPropertyDO property = ProductPropertyConvert.INSTANCE.convert(createReqVO); + productPropertyMapper.insert(property); + + //插入属性值 + List propertyValueList = createReqVO.getPropertyValueList(); + List productPropertyValueDOList = ProductPropertyValueConvert.INSTANCE.convertList03(propertyValueList); + productPropertyValueDOList.stream().forEach(x-> x.setPropertyId(property.getId())); + productPropertyValueMapper.insertBatch(productPropertyValueDOList); + // 返回 + return property.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateProperty(ProductPropertyUpdateReqVO updateReqVO) { + // 校验存在 + this.validatePropertyExists(updateReqVO.getId()); + // 更新 + ProductPropertyDO updateObj = ProductPropertyConvert.INSTANCE.convert(updateReqVO); + productPropertyMapper.updateById(updateObj); + //更新属性值,先删后加 + productPropertyValueMapper.deletePropertyValueByPropertyId(updateReqVO.getId()); + List propertyValueList = updateReqVO.getPropertyValueList(); + List productPropertyValueDOList = ProductPropertyValueConvert.INSTANCE.convertList03(propertyValueList); + productPropertyValueDOList.stream().forEach(x-> x.setPropertyId(updateReqVO.getId())); + productPropertyValueMapper.insertBatch(productPropertyValueDOList); + } + + @Override + public void deleteProperty(Long id) { + // 校验存在 + this.validatePropertyExists(id); + // 删除 + productPropertyMapper.deleteById(id); + //同步删除属性值 + productPropertyValueMapper.deletePropertyValueByPropertyId(id); + } + + private void validatePropertyExists(Long id) { + if (productPropertyMapper.selectById(id) == null) { + throw exception(PROPERTY_NOT_EXISTS); + } + } + + @Override + public ProductPropertyDO getProperty(Long id) { + return productPropertyMapper.selectById(id); + } + + @Override + public List getPropertyList(Collection ids) { + return productPropertyMapper.selectBatchIds(ids); + } + + @Override + public PageResult getPropertyPage(ProductPropertyPageReqVO pageReqVO) { + return productPropertyMapper.selectPage(pageReqVO); + } + + @Override + public List getPropertyList(ProductPropertyExportReqVO exportReqVO) { + return productPropertyMapper.selectList(exportReqVO); + } + + @Override + public PageResult getPropertyListPage(ProductPropertyPageReqVO pageReqVO) { + //获取属性列表 + PageResult pageResult = productPropertyMapper.selectPage(pageReqVO); + PageResult propertyRespVOPageResult = ProductPropertyConvert.INSTANCE.convertPage(pageResult); + List propertyIds = propertyRespVOPageResult.getList().stream().map(ProductPropertyRespVO::getId).collect(Collectors.toList()); + + //获取属性值列表 + List productPropertyValueDOList = productPropertyValueMapper.getPropertyValueListByPropertyId(propertyIds); + List propertyValueRespVOList = ProductPropertyValueConvert.INSTANCE.convertList(productPropertyValueDOList); + //组装一对多 + propertyRespVOPageResult.getList().forEach(x->{ + Long propertyId = x.getId(); + List valueDOList = propertyValueRespVOList.stream().filter(v -> v.getPropertyId().equals(propertyId)).collect(Collectors.toList()); + x.setPropertyValueList(valueDOList); + }); + return propertyRespVOPageResult; + } + + private List getPropertyValueListByPropertyId(List propertyIds) { + return productPropertyValueMapper.getPropertyValueListByPropertyId(propertyIds); + } + + @Override + public ProductPropertyRespVO getPropertyResp(Long id) { + //查询规格 + ProductPropertyDO property = getProperty(id); + ProductPropertyRespVO propertyRespVO = ProductPropertyConvert.INSTANCE.convert(property); + //查询属性值 + List valueDOList = productPropertyValueMapper.getPropertyValueListByPropertyId(Arrays.asList(id)); + List propertyValueRespVOS = ProductPropertyValueConvert.INSTANCE.convertList(valueDOList); + //组装 + propertyRespVO.setPropertyValueList(propertyValueRespVOS); + return propertyRespVO; + } + + @Override + public List selectByIds(List propertyIds) { + List productPropertyRespVO = ProductPropertyConvert.INSTANCE.convertList(productPropertyMapper.selectBatchIds(propertyIds)); + //查询属性值 + List valueDOList = productPropertyValueMapper.getPropertyValueListByPropertyId(propertyIds); + Map> propertyValuesMap = valueDOList.stream().collect(Collectors.groupingBy(ProductPropertyValueDO::getPropertyId)); + productPropertyRespVO.forEach(p -> p.setPropertyValueList(ProductPropertyValueConvert.INSTANCE.convertList(propertyValuesMap.get(p.getId())))); + return productPropertyRespVO; + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java new file mode 100755 index 000000000..0396506ef --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java @@ -0,0 +1,119 @@ +package cn.iocoder.yudao.module.product.service.sku; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuExportReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuPageReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuUpdateReqVO; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; + +import javax.validation.Valid; +import java.util.Collection; +import java.util.List; + +/** + * 商品sku Service 接口 + * + * @author 芋道源码 + */ +public interface ProductSkuService { + + /** + * 创建商品sku + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createSku(@Valid ProductSkuCreateReqVO createReqVO); + + /** + * 更新商品sku + * + * @param updateReqVO 更新信息 + */ + void updateSku(@Valid ProductSkuUpdateReqVO updateReqVO); + + /** + * 删除商品sku + * + * @param id 编号 + */ + void deleteSku(Long id); + + /** + * 获得商品sku + * + * @param id 编号 + * @return 商品sku + */ + ProductSkuDO getSku(Long id); + + /** + * 获得商品sku列表 + * + * @param ids 编号 + * @return 商品sku列表 + */ + List getSkuList(Collection ids); + + /** + * 获得商品sku分页 + * + * @param pageReqVO 分页查询 + * @return 商品sku分页 + */ + PageResult getSkuPage(ProductSkuPageReqVO pageReqVO); + + /** + * 获得商品sku列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 商品sku列表 + */ + List getSkuList(ProductSkuExportReqVO exportReqVO); + + /** + * 对 sku 的组合的属性等进行合法性校验 + * + * @param list sku组合的集合 + */ + void validateSkus(List list); + + /** + * 批量保存 sku + * + * @param list sku对象集合 + */ + void createSkus(List list); + + /** + * 获得商品 sku 集合 + * + * @param spuId spu 编号 + * @return 商品sku 集合 + */ + List getSkusBySpuId(Long spuId); + + /** + * 获得 spu 对应的 sku 集合 + * + * @param spuIds spu 编码集合 + * @return 商品 sku 集合 + */ + List getSkusBySpuIds(List spuIds); + + /** + * 通过 spuId 删除 sku 信息 + * + * @param spuId spu 编码 + */ + void deleteSkuBySpuId(Long spuId); + + /** + * 根据 spuId 更新 spu 下的 sku 信息 + * + * @param spuId spu 编码 + * @param skus sku 的集合 + */ + void updateSkus(Long spuId, List skus); +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java new file mode 100755 index 000000000..91a60929b --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java @@ -0,0 +1,185 @@ +package cn.iocoder.yudao.module.product.service.sku; + +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyRespVO; +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.*; +import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import cn.iocoder.yudao.module.product.dal.mysql.sku.ProductSkuMapper; +import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants; +import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_NOT_EXISTS; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SKU_NOT_EXISTS; + +/** + * 商品sku Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ProductSkuServiceImpl implements ProductSkuService { + + @Resource + private ProductSkuMapper productSkuMapper; + + @Resource + private ProductPropertyService productPropertyService; + + @Override + public Long createSku(ProductSkuCreateReqVO createReqVO) { + // 插入 + ProductSkuDO sku = ProductSkuConvert.INSTANCE.convert(createReqVO); + productSkuMapper.insert(sku); + // 返回 + return sku.getId(); + } + + @Override + public void updateSku(ProductSkuUpdateReqVO updateReqVO) { + // 校验存在 + this.validateSkuExists(updateReqVO.getId()); + // 更新 + ProductSkuDO updateObj = ProductSkuConvert.INSTANCE.convert(updateReqVO); + productSkuMapper.updateById(updateObj); + } + + @Override + public void deleteSku(Long id) { + // 校验存在 + this.validateSkuExists(id); + // 删除 + productSkuMapper.deleteById(id); + } + + private void validateSkuExists(Long id) { + if (productSkuMapper.selectById(id) == null) { + throw exception(SKU_NOT_EXISTS); + } + } + + @Override + public ProductSkuDO getSku(Long id) { + return productSkuMapper.selectById(id); + } + + @Override + public List getSkuList(Collection ids) { + return productSkuMapper.selectBatchIds(ids); + } + + @Override + public PageResult getSkuPage(ProductSkuPageReqVO pageReqVO) { + return productSkuMapper.selectPage(pageReqVO); + } + + @Override + public List getSkuList(ProductSkuExportReqVO exportReqVO) { + return productSkuMapper.selectList(exportReqVO); + } + + // TODO @franky:这个方法,貌似实现的还是有点问题哈。例如说,throw 异常,后面还执行逻辑~ + // TODO @艿艿 咳咳,throw 那里我是偷懒省略了{},哈哈,我加上,然后我调试下,在优化下 + @Override + public void validateSkus(List list) { + List skuPropertyList = list.stream().flatMap(p -> p.getProperties().stream()).collect(Collectors.toList()); + // 校验规格属性以及规格值是否存在 + List propertyIds = skuPropertyList.stream().map(ProductSkuBaseVO.Property::getPropertyId).collect(Collectors.toList()); + List propertyAndValueList = productPropertyService.selectByIds(propertyIds); + if (propertyAndValueList.isEmpty()) { + throw ServiceExceptionUtil.exception(PROPERTY_NOT_EXISTS); + } + Map propertyMap = propertyAndValueList.stream().collect(Collectors.toMap(ProductPropertyRespVO::getId, p -> p)); + skuPropertyList.forEach(p -> { + ProductPropertyRespVO productPropertyRespVO = propertyMap.get(p.getPropertyId()); + // 如果对应的属性名不存在或属性名下的属性值集合为空,给出提示 + if (null == productPropertyRespVO || productPropertyRespVO.getPropertyValueList().isEmpty()) + throw ServiceExceptionUtil.exception(PROPERTY_NOT_EXISTS); + // 判断改属性名对应的属性值是否存在,不存在,给出提示 + if (!productPropertyRespVO.getPropertyValueList().stream().map(ProductPropertyValueRespVO::getId).collect(Collectors.toSet()).contains(p.getValueId())) { + throw ServiceExceptionUtil.exception(ErrorCodeConstants.PROPERTY_VALUE_NOT_EXISTS); + } + }); + // 校验是否有重复的sku组合 + List> skuProperties = list.stream().map(ProductSkuBaseVO::getProperties).collect(Collectors.toList()); + Set skuPropertiesConvertSet = new HashSet<>(); + skuProperties.forEach(p -> { + // 组合属性值id为 1~2~3.... 形式的字符串,通过set的特性判断是否有重复的组合 + if (!skuPropertiesConvertSet.add(p.stream().map(pr -> String.valueOf(pr.getValueId())).sorted().collect(Collectors.joining("~")))) { + throw ServiceExceptionUtil.exception(ErrorCodeConstants.SKU_PROPERTIES_DUPLICATED); + } + }); + } + + @Override + public void createSkus(List skuDOList) { + productSkuMapper.insertBatch(skuDOList); + } + + @Override + public List getSkusBySpuId(Long spuId) { + return productSkuMapper.selectBySpuIds(Collections.singletonList(spuId)); + } + + @Override + public List getSkusBySpuIds(List spuIds) { + return productSkuMapper.selectBySpuIds(spuIds); + } + + @Override + public void deleteSkuBySpuId(Long spuId) { + productSkuMapper.deleteBySpuId(spuId); + } + + @Override + @Transactional + public void updateSkus(Long spuId, List skus) { + List allUpdateSkus = ProductSkuConvert.INSTANCE.convertSkuDOList(skus); + // 查询 spu 下已经存在的 sku 的集合 + List existsSkus = productSkuMapper.selectBySpuIds(Collections.singletonList(spuId)); + // TODO @franky:使用 CollUtils 即可 + Map existsSkuMap = existsSkus.stream().collect(Collectors.toMap(ProductSkuDO::getId, p -> p)); + + // 拆分三个集合, 新插入的, 需要更新的,需要删除的 + List insertSkus = new ArrayList<>(); + List updateSkus = new ArrayList<>(); + List deleteSkus = new ArrayList<>(); + + // TODO @芋艿:是不是基于规格匹配会比较好。 + allUpdateSkus.forEach(p -> { + if (null != p.getId()) { + if (existsSkuMap.get(p.getId()) != null) { + updateSkus.add(p); + return; + } + deleteSkus.add(p); + return; + } + p.setSpuId(spuId); + insertSkus.add(p); + }); + + if (insertSkus.size() > 0) { + productSkuMapper.insertBatch(insertSkus); + } + + if (updateSkus.size() > 0) { + updateSkus.forEach(p -> productSkuMapper.updateById(p)); + } + + if (deleteSkus.size() > 0) { + productSkuMapper.deleteBatchIds(deleteSkus.stream().map(ProductSkuDO::getId).collect(Collectors.toList())); + } + } +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuService.java new file mode 100755 index 000000000..e4fc47d56 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.product.service.spu; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 商品spu Service 接口 + * + * @author 芋道源码 + */ +public interface ProductSpuService { + + /** + * 创建商品spu + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createSpu(@Valid ProductSpuCreateReqVO createReqVO); + + /** + * 更新商品spu + * + * @param updateReqVO 更新信息 + */ + void updateSpu(@Valid SpuUpdateReqVO updateReqVO); + + /** + * 删除商品spu + * + * @param id 编号 + */ + void deleteSpu(Long id); + + /** + * 获得商品spu + * + * @param id 编号 + * @return 商品spu + */ + SpuRespVO getSpu(Long id); + + /** + * 获得商品spu列表 + * + * @param ids 编号 + * @return 商品spu列表 + */ + List getSpuList(Collection ids); + + /** + * 获得商品spu分页 + * + * @param pageReqVO 分页查询 + * @return 商品spu分页 + */ + PageResult getSpuPage(SpuPageReqVO pageReqVO); + + /** + * 获得商品spu列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 商品spu列表 + */ + List getSpuList(SpuExportReqVO exportReqVO); + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java new file mode 100755 index 000000000..4420b0af8 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java @@ -0,0 +1,147 @@ +package cn.iocoder.yudao.module.product.service.spu; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuRespVO; +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; +import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; +import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper; +import cn.iocoder.yudao.module.product.service.category.CategoryService; +import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_EXISTS; + +/** + * 商品spu Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ProductSpuServiceImpl implements ProductSpuService { + + @Resource + private ProductSpuMapper ProductSpuMapper; + + @Resource + private CategoryService categoryService; + + @Resource + private ProductSkuService productSkuService; + + @Override + @Transactional + public Long createSpu(ProductSpuCreateReqVO createReqVO) { + // 校验分类 + categoryService.validatedCategoryById(createReqVO.getCategoryId()); + // 校验SKU + List skuCreateReqList = createReqVO.getSkus(); + productSkuService.validateSkus(skuCreateReqList); + // 插入SPU + ProductSpuDO spu = ProductSpuConvert.INSTANCE.convert(createReqVO); + ProductSpuMapper.insert(spu); + // sku关联SPU属性 + skuCreateReqList.forEach(p -> { + p.setSpuId(spu.getId()); + }); + List skuDOList = ProductSkuConvert.INSTANCE.convertSkuDOList(skuCreateReqList); + // 批量插入sku + productSkuService.createSkus(skuDOList); + // 返回 + return spu.getId(); + } + + @Override + @Transactional + public void updateSpu(SpuUpdateReqVO updateReqVO) { + // 校验 spu 是否存在 + this.validateSpuExists(updateReqVO.getId()); + // 校验分类 + categoryService.validatedCategoryById(updateReqVO.getCategoryId()); + // 校验SKU + List skuCreateReqList = updateReqVO.getSkus(); + productSkuService.validateSkus(skuCreateReqList); + // 更新 + ProductSpuDO updateObj = ProductSpuConvert.INSTANCE.convert(updateReqVO); + ProductSpuMapper.updateById(updateObj); + // 更新 sku + productSkuService.updateSkus(updateObj.getId(), updateReqVO.getSkus()); + } + + @Override + @Transactional + public void deleteSpu(Long id) { + // 校验存在 + this.validateSpuExists(id); + // 删除 SPU + ProductSpuMapper.deleteById(id); + // 删除关联的 SKU + productSkuService.deleteSkuBySpuId(id); + } + + private void validateSpuExists(Long id) { + if (ProductSpuMapper.selectById(id) == null) { + throw exception(SPU_NOT_EXISTS); + } + } + + @Override + public SpuRespVO getSpu(Long id) { + ProductSpuDO spu = ProductSpuMapper.selectById(id); + SpuRespVO spuVO = ProductSpuConvert.INSTANCE.convert(spu); + if (null != spuVO) { + List skuReqs = ProductSkuConvert.INSTANCE.convertList(productSkuService.getSkusBySpuId(id)); + spuVO.setSkus(skuReqs); + // 组合分类 + if (null != spuVO.getCategoryId()) { + LinkedList categoryArray = new LinkedList<>(); + Long parentId = spuVO.getCategoryId(); + categoryArray.addFirst(parentId); + while (parentId != 0) { + parentId = categoryService.getCategory(parentId).getParentId(); + if (parentId > 0) { + categoryArray.addFirst(parentId); + } + } + spuVO.setCategoryIds(categoryArray); + } + } + return spuVO; + } + + @Override + public List getSpuList(Collection ids) { + return ProductSpuMapper.selectBatchIds(ids); + } + + @Override + public PageResult getSpuPage(SpuPageReqVO pageReqVO) { + PageResult spuVOs = ProductSpuConvert.INSTANCE.convertPage(ProductSpuMapper.selectPage(pageReqVO)); + // 查询 sku 的信息 + List spuIds = spuVOs.getList().stream().map(SpuRespVO::getId).collect(Collectors.toList()); + List skus = ProductSkuConvert.INSTANCE.convertList(productSkuService.getSkusBySpuIds(spuIds)); + // TODO @franky:使用 CollUtil 里的方法替代哈 + Map> skuMap = skus.stream().collect(Collectors.groupingBy(ProductSkuRespVO::getSpuId)); + // 将 spu 和 sku 进行组装 + spuVOs.getList().forEach(p -> p.setSkus(skuMap.get(p.getId()))); + return spuVOs; + } + + @Override + public List getSpuList(SpuExportReqVO exportReqVO) { + return ProductSpuMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java new file mode 100644 index 000000000..eb1a07cfa --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java @@ -0,0 +1,175 @@ +package cn.iocoder.yudao.module.product.service.brand; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; + +import javax.annotation.Resource; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; + +import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO; +import cn.iocoder.yudao.module.product.dal.mysql.brand.BrandMapper; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import javax.annotation.Resource; +import org.springframework.context.annotation.Import; +import java.util.*; + +import static cn.hutool.core.util.RandomUtil.*; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +/** +* {@link BrandServiceImpl} 的单元测试类 +* +* @author 芋道源码 +*/ +@Import(BrandServiceImpl.class) +public class BrandServiceImplTest extends BaseDbUnitTest { + + @Resource + private BrandServiceImpl brandService; + + @Resource + private BrandMapper brandMapper; + + @Test + public void testCreateBrand_success() { + // 准备参数 + BrandCreateReqVO reqVO = randomPojo(BrandCreateReqVO.class); + + // 调用 + Long brandId = brandService.createBrand(reqVO); + // 断言 + assertNotNull(brandId); + // 校验记录的属性是否正确 + BrandDO brand = brandMapper.selectById(brandId); + assertPojoEquals(reqVO, brand); + } + + @Test + public void testUpdateBrand_success() { + // mock 数据 + BrandDO dbBrand = randomPojo(BrandDO.class); + brandMapper.insert(dbBrand);// @Sql: 先插入出一条存在的数据 + // 准备参数 + BrandUpdateReqVO reqVO = randomPojo(BrandUpdateReqVO.class, o -> { + o.setId(dbBrand.getId()); // 设置更新的 ID + }); + + // 调用 + brandService.updateBrand(reqVO); + // 校验是否更新正确 + BrandDO brand = brandMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, brand); + } + + @Test + public void testUpdateBrand_notExists() { + // 准备参数 + BrandUpdateReqVO reqVO = randomPojo(BrandUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> brandService.updateBrand(reqVO), BRAND_NOT_EXISTS); + } + + @Test + public void testDeleteBrand_success() { + // mock 数据 + BrandDO dbBrand = randomPojo(BrandDO.class); + brandMapper.insert(dbBrand);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbBrand.getId(); + + // 调用 + brandService.deleteBrand(id); + // 校验数据不存在了 + assertNull(brandMapper.selectById(id)); + } + + @Test + public void testDeleteBrand_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> brandService.deleteBrand(id), BRAND_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetBrandPage() { + // mock 数据 + BrandDO dbBrand = randomPojo(BrandDO.class, o -> { // 等会查询到 + o.setCategoryId(null); + o.setName(null); + o.setStatus(null); + o.setCreateTime(null); + }); + brandMapper.insert(dbBrand); + // 测试 categoryId 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setCategoryId(null))); + // 测试 name 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setName(null))); + // 测试 status 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setCreateTime(null))); + // 准备参数 + BrandPageReqVO reqVO = new BrandPageReqVO(); + reqVO.setCategoryId(null); + reqVO.setName(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + PageResult pageResult = brandService.getBrandPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbBrand, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetBrandList() { + // mock 数据 + BrandDO dbBrand = randomPojo(BrandDO.class, o -> { // 等会查询到 + o.setCategoryId(null); + o.setName(null); + o.setStatus(null); + o.setCreateTime(null); + }); + brandMapper.insert(dbBrand); + // 测试 categoryId 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setCategoryId(null))); + // 测试 name 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setName(null))); + // 测试 status 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + brandMapper.insert(cloneIgnoreId(dbBrand, o -> o.setCreateTime(null))); + // 准备参数 + BrandExportReqVO reqVO = new BrandExportReqVO(); + reqVO.setCategoryId(null); + reqVO.setName(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + List list = brandService.getBrandList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbBrand, list.get(0)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java new file mode 100644 index 000000000..5749e65ee --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java @@ -0,0 +1,194 @@ +package cn.iocoder.yudao.module.product.service.category; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryExportReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryPageReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.CategoryUpdateReqVO; +import cn.iocoder.yudao.module.product.dal.dataobject.category.CategoryDO; +import cn.iocoder.yudao.module.product.dal.mysql.category.CategoryMapper; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.CATEGORY_NOT_EXISTS; +import static org.junit.jupiter.api.Assertions.*; + +/** + * {@link CategoryServiceImpl} 的单元测试类 + * + * @author 芋道源码 + */ +@Import(CategoryServiceImpl.class) +public class CategoryServiceImplTest extends BaseDbUnitTest { + + @Resource + private CategoryServiceImpl categoryService; + + @Resource + private CategoryMapper categoryMapper; + + @Test + public void testCreateCategory_success() { + // 准备参数 + CategoryCreateReqVO reqVO = randomPojo(CategoryCreateReqVO.class); + + // 调用 + Long categoryId = categoryService.createCategory(reqVO); + // 断言 + assertNotNull(categoryId); + // 校验记录的属性是否正确 + CategoryDO category = categoryMapper.selectById(categoryId); + assertPojoEquals(reqVO, category); + } + + @Test + public void testUpdateCategory_success() { + // mock 数据 + CategoryDO dbCategory = randomPojo(CategoryDO.class); + categoryMapper.insert(dbCategory);// @Sql: 先插入出一条存在的数据 + // 准备参数 + CategoryUpdateReqVO reqVO = randomPojo(CategoryUpdateReqVO.class, o -> { + o.setId(dbCategory.getId()); // 设置更新的 ID + }); + + // 调用 + categoryService.updateCategory(reqVO); + // 校验是否更新正确 + CategoryDO category = categoryMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, category); + } + + @Test + public void testUpdateCategory_notExists() { + // 准备参数 + CategoryUpdateReqVO reqVO = randomPojo(CategoryUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> categoryService.updateCategory(reqVO), CATEGORY_NOT_EXISTS); + } + + @Test + public void testDeleteCategory_success() { + // mock 数据 + CategoryDO dbCategory = randomPojo(CategoryDO.class); + categoryMapper.insert(dbCategory);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbCategory.getId(); + + // 调用 + categoryService.deleteCategory(id); + // 校验数据不存在了 + assertNull(categoryMapper.selectById(id)); + } + + @Test + public void testDeleteCategory_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> categoryService.deleteCategory(id), CATEGORY_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetCategoryPage() { + // mock 数据 + CategoryDO dbCategory = randomPojo(CategoryDO.class, o -> { // 等会查询到 + o.setParentId(null); + o.setName(null); + o.setIcon(null); + o.setBannerUrl(null); + o.setSort(null); + o.setDescription(null); + o.setStatus(null); + o.setCreateTime(null); + }); + categoryMapper.insert(dbCategory); + // 测试 pid 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setParentId(null))); + // 测试 name 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setName(null))); + // 测试 icon 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setIcon(null))); + // 测试 bannerUrl 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setBannerUrl(null))); + // 测试 sort 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setSort(null))); + // 测试 description 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setDescription(null))); + // 测试 status 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setCreateTime(null))); + // 准备参数 + CategoryPageReqVO reqVO = new CategoryPageReqVO(); + reqVO.setName(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + PageResult pageResult = categoryService.getCategoryPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbCategory, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetCategoryList() { + // mock 数据 + CategoryDO dbCategory = randomPojo(CategoryDO.class, o -> { // 等会查询到 + o.setParentId(null); + o.setName(null); + o.setIcon(null); + o.setBannerUrl(null); + o.setSort(null); + o.setDescription(null); + o.setStatus(null); + o.setCreateTime(null); + }); + categoryMapper.insert(dbCategory); + // 测试 pid 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setParentId(null))); + // 测试 name 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setName(null))); + // 测试 icon 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setIcon(null))); + // 测试 bannerUrl 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setBannerUrl(null))); + // 测试 sort 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setSort(null))); + // 测试 description 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setDescription(null))); + // 测试 status 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + categoryMapper.insert(cloneIgnoreId(dbCategory, o -> o.setCreateTime(null))); + // 准备参数 + CategoryExportReqVO reqVO = new CategoryExportReqVO(); + reqVO.setName(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + List list = categoryService.getCategoryList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbCategory, list.get(0)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java new file mode 100755 index 000000000..4253b6fd0 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java @@ -0,0 +1,215 @@ +package cn.iocoder.yudao.module.product.service.sku; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; + +import javax.annotation.Resource; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; + +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import cn.iocoder.yudao.module.product.dal.mysql.sku.ProductSkuMapper; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import javax.annotation.Resource; +import org.springframework.context.annotation.Import; +import java.util.*; + +import static cn.hutool.core.util.RandomUtil.*; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +/** +* {@link ProductSkuServiceImpl} 的单元测试类 +* +* @author 芋道源码 +*/ +@Import(ProductSkuServiceImpl.class) +public class SkuServiceImplTest extends BaseDbUnitTest { + + @Resource + private ProductSkuServiceImpl ProductSkuService; + + @Resource + private ProductSkuMapper ProductSkuMapper; + + @Test + public void testCreateSku_success() { + // 准备参数 + ProductSkuCreateReqVO reqVO = randomPojo(ProductSkuCreateReqVO.class); + + // 调用 + Long skuId = ProductSkuService.createSku(reqVO); + // 断言 + assertNotNull(skuId); + // 校验记录的属性是否正确 + ProductSkuDO sku = ProductSkuMapper.selectById(skuId); + assertPojoEquals(reqVO, sku); + } + + @Test + public void testUpdateSku_success() { + // mock 数据 + ProductSkuDO dbSku = randomPojo(ProductSkuDO.class); + ProductSkuMapper.insert(dbSku);// @Sql: 先插入出一条存在的数据 + // 准备参数 + ProductSkuUpdateReqVO reqVO = randomPojo(ProductSkuUpdateReqVO.class, o -> { + o.setId(dbSku.getId()); // 设置更新的 ID + }); + + // 调用 + ProductSkuService.updateSku(reqVO); + // 校验是否更新正确 + ProductSkuDO sku = ProductSkuMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, sku); + } + + @Test + public void testUpdateSku_notExists() { + // 准备参数 + ProductSkuUpdateReqVO reqVO = randomPojo(ProductSkuUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> ProductSkuService.updateSku(reqVO), SKU_NOT_EXISTS); + } + + @Test + public void testDeleteSku_success() { + // mock 数据 + ProductSkuDO dbSku = randomPojo(ProductSkuDO.class); + ProductSkuMapper.insert(dbSku);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbSku.getId(); + + // 调用 + ProductSkuService.deleteSku(id); + // 校验数据不存在了 + assertNull(ProductSkuMapper.selectById(id)); + } + + @Test + public void testDeleteSku_notExists() { + // 准备参数 + Long id = 1L; + + // 调用, 并断言异常 + assertServiceException(() -> ProductSkuService.deleteSku(id), SKU_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSkuPage() { + // mock 数据 + ProductSkuDO dbSku = randomPojo(ProductSkuDO.class, o -> { // 等会查询到 + o.setSpuId(null); + o.setProperties(null); + o.setPrice(null); + o.setOriginalPrice(null); + o.setCostPrice(null); + o.setBarCode(null); + o.setPicUrl(null); + o.setStatus(null); + o.setCreateTime(null); + }); + ProductSkuMapper.insert(dbSku); + // 测试 spuId 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setSpuId(null))); + // 测试 properties 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setProperties(null))); + // 测试 price 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setPrice(null))); + // 测试 originalPrice 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setOriginalPrice(null))); + // 测试 costPrice 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setCostPrice(null))); + // 测试 barCode 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setBarCode(null))); + // 测试 picUrl 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setPicUrl(null))); + // 测试 status 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setCreateTime(null))); + // 准备参数 + ProductSkuPageReqVO reqVO = new ProductSkuPageReqVO(); + reqVO.setSpuId(null); + reqVO.setProperties(null); + reqVO.setPrice(null); + reqVO.setOriginalPrice(null); + reqVO.setCostPrice(null); + reqVO.setBarCode(null); + reqVO.setPicUrl(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + PageResult pageResult = ProductSkuService.getSkuPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbSku, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSkuList() { + // mock 数据 + ProductSkuDO dbSku = randomPojo(ProductSkuDO.class, o -> { // 等会查询到 + o.setSpuId(null); + o.setProperties(null); + o.setPrice(null); + o.setOriginalPrice(null); + o.setCostPrice(null); + o.setBarCode(null); + o.setPicUrl(null); + o.setStatus(null); + o.setCreateTime(null); + }); + ProductSkuMapper.insert(dbSku); + // 测试 spuId 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setSpuId(null))); + // 测试 properties 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setProperties(null))); + // 测试 price 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setPrice(null))); + // 测试 originalPrice 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setOriginalPrice(null))); + // 测试 costPrice 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setCostPrice(null))); + // 测试 barCode 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setBarCode(null))); + // 测试 picUrl 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setPicUrl(null))); + // 测试 status 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setCreateTime(null))); + // 准备参数 + ProductSkuExportReqVO reqVO = new ProductSkuExportReqVO(); + reqVO.setSpuId(null); + reqVO.setProperties(null); + reqVO.setPrice(null); + reqVO.setOriginalPrice(null); + reqVO.setCostPrice(null); + reqVO.setBarCode(null); + reqVO.setPicUrl(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + List list = ProductSkuService.getSkuList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbSku, list.get(0)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java new file mode 100755 index 000000000..6e943f234 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java @@ -0,0 +1,231 @@ +package cn.iocoder.yudao.module.product.service.spu; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; + +import javax.annotation.Resource; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; + +import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import javax.annotation.Resource; +import org.springframework.context.annotation.Import; +import java.util.*; + +import static cn.hutool.core.util.RandomUtil.*; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +/** +* {@link ProductSpuServiceImpl} 的单元测试类 +* +* @author 芋道源码 +*/ +@Import(ProductSpuServiceImpl.class) +public class ProductSpuServiceImplTest extends BaseDbUnitTest { + + @Resource + private ProductSpuServiceImpl spuService; + + @Resource + private ProductSpuMapper ProductSpuMapper; + + @Test + public void testCreateSpu_success() { + // 准备参数 + ProductSpuCreateReqVO reqVO = randomPojo(ProductSpuCreateReqVO.class); + + // 调用 + Long spuId = spuService.createSpu(reqVO); + // 断言 + assertNotNull(spuId); + // 校验记录的属性是否正确 + ProductSpuDO spu = ProductSpuMapper.selectById(spuId); + assertPojoEquals(reqVO, spu); + } + + @Test + public void testUpdateSpu_success() { + // mock 数据 + ProductSpuDO dbSpu = randomPojo(ProductSpuDO.class); + ProductSpuMapper.insert(dbSpu);// @Sql: 先插入出一条存在的数据 + // 准备参数 + SpuUpdateReqVO reqVO = randomPojo(SpuUpdateReqVO.class, o -> { + o.setId(dbSpu.getId()); // 设置更新的 ID + }); + + // 调用 + spuService.updateSpu(reqVO); + // 校验是否更新正确 + ProductSpuDO spu = ProductSpuMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, spu); + } + + @Test + public void testUpdateSpu_notExists() { + // 准备参数 + SpuUpdateReqVO reqVO = randomPojo(SpuUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> spuService.updateSpu(reqVO), SPU_NOT_EXISTS); + } + + @Test + public void testDeleteSpu_success() { + // mock 数据 + ProductSpuDO dbSpu = randomPojo(ProductSpuDO.class); + ProductSpuMapper.insert(dbSpu);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbSpu.getId(); + + // 调用 + spuService.deleteSpu(id); + // 校验数据不存在了 + assertNull(ProductSpuMapper.selectById(id)); + } + + @Test + public void testDeleteSpu_notExists() { + // 准备参数 + Long id = 1L; + + // 调用, 并断言异常 + assertServiceException(() -> spuService.deleteSpu(id), SPU_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSpuPage() { + // mock 数据 + ProductSpuDO dbSpu = randomPojo(ProductSpuDO.class, o -> { // 等会查询到 + o.setName(null); + o.setSellPoint(null); + o.setDescription(null); + o.setCategoryId(null); + o.setPicUrls(null); + o.setSort(null); + o.setLikeCount(null); + o.setPrice(null); + o.setQuantity(null); + o.setStatus(null); + o.setCreateTime(null); + }); + ProductSpuMapper.insert(dbSpu); + // 测试 name 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setName(null))); + // 测试 sellPoint 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setSellPoint(null))); + // 测试 description 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setDescription(null))); + // 测试 categoryId 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setCategoryId(null))); + // 测试 picUrls 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPicUrls(null))); + // 测试 sort 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setSort(null))); + // 测试 likeCount 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setLikeCount(null))); + // 测试 price 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPrice(null))); + // 测试 quantity 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setQuantity(null))); + // 测试 status 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setCreateTime(null))); + // 准备参数 + SpuPageReqVO reqVO = new SpuPageReqVO(); + reqVO.setName(null); + reqVO.setSellPoint(null); + reqVO.setDescription(null); + reqVO.setCategoryId(null); + reqVO.setPicUrls(null); + reqVO.setSort(null); + reqVO.setLikeCount(null); + reqVO.setPrice(null); + reqVO.setQuantity(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + PageResult pageResult = spuService.getSpuPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbSpu, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSpuList() { + // mock 数据 + ProductSpuDO dbSpu = randomPojo(ProductSpuDO.class, o -> { // 等会查询到 + o.setName(null); + o.setSellPoint(null); + o.setDescription(null); + o.setCategoryId(null); + o.setPicUrls(null); + o.setSort(null); + o.setLikeCount(null); + o.setPrice(null); + o.setQuantity(null); + o.setStatus(null); + o.setCreateTime(null); + }); + ProductSpuMapper.insert(dbSpu); + // 测试 name 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setName(null))); + // 测试 sellPoint 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setSellPoint(null))); + // 测试 description 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setDescription(null))); + // 测试 categoryId 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setCategoryId(null))); + // 测试 picUrls 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPicUrls(null))); + // 测试 sort 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setSort(null))); + // 测试 likeCount 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setLikeCount(null))); + // 测试 price 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPrice(null))); + // 测试 quantity 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setQuantity(null))); + // 测试 status 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setStatus(null))); + // 测试 createTime 不匹配 + ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setCreateTime(null))); + // 准备参数 + SpuExportReqVO reqVO = new SpuExportReqVO(); + reqVO.setName(null); + reqVO.setSellPoint(null); + reqVO.setDescription(null); + reqVO.setCategoryId(null); + reqVO.setPicUrls(null); + reqVO.setSort(null); + reqVO.setLikeCount(null); + reqVO.setPrice(null); + reqVO.setQuantity(null); + reqVO.setStatus(null); + reqVO.setBeginCreateTime(null); + reqVO.setEndCreateTime(null); + + // 调用 + List list = spuService.getSpuList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbSpu, list.get(0)); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql new file mode 100644 index 000000000..d9a04afed --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql @@ -0,0 +1,3 @@ +DELETE FROM "product_category"; + +DELETE FROM "product_brand"; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql new file mode 100644 index 000000000..94f0b7937 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql @@ -0,0 +1,34 @@ +CREATE TABLE IF NOT EXISTS "product_category" ( + "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "parent_id" bigint(20) NOT NULL, + "name" varchar(255) NOT NULL, + "icon" varchar(100), + "banner_url" varchar(255) NOT NULL, + "sort" int(11) NOT NULL, + "description" varchar(1024) NOT NULL, + "status" tinyint(4) NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint(20) NOT NULL, + PRIMARY KEY ("id") +) COMMENT '商品分类'; + +CREATE TABLE IF NOT EXISTS "product_brand" ( + "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "category_id" bigint(20) NOT NULL, + "name" varchar(255) NOT NULL, + "banner_url" varchar(255) NOT NULL, + "sort" int(11), + "description" varchar(1024), + "status" tinyint(4) NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint(20) NOT NULL, + PRIMARY KEY ("id") +) COMMENT '品牌'; diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserInfoDTO.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserInfoDTO.java new file mode 100644 index 000000000..a814edad0 --- /dev/null +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserInfoDTO.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.member.api.user.dto; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 Response DTO + * + * @author 芋道源码 + */ +@Data +public class UserInfoDTO { + + /** + * 用户ID + */ + private Long id; + /** + * 用户昵称 + */ + private String nickname; + /** + * 用户头像 + */ + private String avatar; + /** + * 帐号状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private Integer status; + + /** + * 手机 + */ + private String mobile; + /** + * 注册 IP + */ + private String registerIp; + /** + * 最后登录IP + */ + private String loginIp; + /** + * 最后登录时间 + */ + private Date loginDate; + +} diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java index 8b4380ca1..2fbb61c8b 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java @@ -13,11 +13,15 @@ public interface ErrorCodeConstants { ErrorCode USER_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在"); ErrorCode USER_PASSWORD_FAILED = new ErrorCode(1004001001, "密码校验失败"); - // ========== AUTH 模块 1004003000 ========== ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1004003000, "登录失败,账号密码不正确"); ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1004003001, "登录失败,账号被禁用"); ErrorCode AUTH_TOKEN_EXPIRED = new ErrorCode(1004003004, "Token 已经过期"); ErrorCode AUTH_THIRD_LOGIN_NOT_BIND = new ErrorCode(1004003005, "未绑定账号,需要进行绑定"); + ErrorCode AUTH_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1004003006, "获得手机号失败"); + + // ========== 用户收件地址 1004004000 ========== + ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); + ErrorCode ADDRESS_FORBIDDEN = new ErrorCode(1004004001, "没有该操作权限"); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java new file mode 100644 index 000000000..795c8162c --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java @@ -0,0 +1,39 @@ +package cn.iocoder.yudao.module.member.controller.admin.user; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.member.api.user.dto.UserInfoDTO; +import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.convert.user.UserConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; +import cn.iocoder.yudao.module.member.service.user.MemberUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; + +/** + * @author Banging + */ +@Slf4j +@Api("用户管理") +@RestController(value = "memberUserController") +@RequestMapping("/user") +public class UserController { + + @Resource + private MemberUserService userService; + + @ApiOperation(value = "用户信息获取",notes = "用户基本信息的获取") + @GetMapping("/{tel}") + public CommonResult getUserInfo(@PathVariable String tel){ + MemberUserDO user = userService.getUserByMobile(tel); + return CommonResult.success(UserConvert.INSTANCE.convertInfo(user)); + } +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.http b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.http new file mode 100644 index 000000000..7f943448a --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.http @@ -0,0 +1,54 @@ +### 请求 /create 接口 => 成功 +POST {{appApi}}//member/address/create +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer 2510e2e4287346eb8e36353a55e27fd6 + +{ + "userId": "245", + "name": "yunai", + "mobile": "15601691300", + "areaCode": "610632", + "detailAddress": "芋道源码 233 号 666 室", + "type": "1" +} + +### 请求 /update 接口 => 成功 +PUT {{appApi}}//member/address/update +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer 2510e2e4287346eb8e36353a55e27fd6 + +{ + "id": "1", + "userId": "245", + "name": "yunai888", + "mobile": "15601691300", + "areaCode": "610632", + "detailAddress": "芋道源码 233 号 666 室", + "type": "1" +} + +### 请求 /delete 接口 => 成功 +DELETE {{appApi}}//member/address/delete?id=2 +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer fa4848b001de4eae9faf516c0c8520f8 + +### 请求 /get 接口 => 成功 +GET {{appApi}}//member/address/get?id=1 +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer fa4848b001de4eae9faf516c0c8520f8 + +### 请求 /get-default 接口 => 成功 +GET {{appApi}}//member/address/get-default +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer fa4848b001de4eae9faf516c0c8520f8 + +### 请求 /list 接口 => 成功 +GET {{appApi}}//member/address/list +Content-Type: application/json +tenant-id: {{appTenentId}} +Authorization: Bearer fa4848b001de4eae9faf516c0c8520f8 \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java new file mode 100644 index 000000000..ee75982fa --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java @@ -0,0 +1,75 @@ +package cn.iocoder.yudao.module.member.controller.app.address; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressCreateReqVO; +import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressRespVO; +import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressUpdateReqVO; +import cn.iocoder.yudao.module.member.convert.address.AddressConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; +import cn.iocoder.yudao.module.member.service.address.AddressService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; + +@Api(tags = "用户 APP - 用户收件地址") +@RestController +@RequestMapping("/member/address") +@Validated +public class AppAddressController { + + @Resource + private AddressService addressService; + + @PostMapping("/create") + @ApiOperation("创建用户收件地址") + public CommonResult createAddress(@Valid @RequestBody AppAddressCreateReqVO createReqVO) { + return success(addressService.createAddress(getLoginUserId(), createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新用户收件地址") + public CommonResult updateAddress(@Valid @RequestBody AppAddressUpdateReqVO updateReqVO) { + addressService.updateAddress(getLoginUserId(), updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除用户收件地址") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + public CommonResult deleteAddress(@RequestParam("id") Long id) { + addressService.deleteAddress(getLoginUserId(), id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得用户收件地址") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + public CommonResult getAddress(@RequestParam("id") Long id) { + AddressDO address = addressService.getAddress(getLoginUserId(), id); + return success(AddressConvert.INSTANCE.convert(address)); + } + + @GetMapping("/get-default") + @ApiOperation("获得默认的用户收件地址") + public CommonResult getDefaultUserAddress() { + AddressDO address = addressService.getDefaultUserAddress(getLoginUserId()); + return success(AddressConvert.INSTANCE.convert(address)); + } + + @GetMapping("/list") + @ApiOperation("获得用户收件地址列表") + public CommonResult> getAddressList() { + List list = addressService.getAddressList(getLoginUserId()); + return success(AddressConvert.INSTANCE.convertList(list)); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/package-info.java deleted file mode 100644 index c8c102186..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.app.address; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java new file mode 100644 index 000000000..81231a881 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.member.controller.app.address.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.member.enums.AddressTypeEnum; +import lombok.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 用户收件地址 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class AppAddressBaseVO { + + @ApiModelProperty(value = "收件人名称", required = true) + @NotNull(message = "收件人名称不能为空") + private String name; + + @ApiModelProperty(value = "手机号", required = true) + @NotNull(message = "手机号不能为空") + private String mobile; + + @ApiModelProperty(value = "地区编码", required = true) + @NotNull(message = "地区编码不能为空") + private Integer areaCode; + + @ApiModelProperty(value = "收件详细地址", required = true) + @NotNull(message = "收件详细地址不能为空") + private String detailAddress; + + @ApiModelProperty(value = "地址类型", required = true) + @NotNull(message = "地址类型不能为空") + @InEnum(AddressTypeEnum.class) + private Integer type; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java new file mode 100644 index 000000000..31fd89fa3 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.member.controller.app.address.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("用户 APP - 用户收件地址创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AppAddressCreateReqVO extends AppAddressBaseVO { + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java new file mode 100644 index 000000000..1005b288c --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.member.controller.app.address.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("用户 APP - 用户收件地址 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AppAddressRespVO extends AppAddressBaseVO { + + @ApiModelProperty(value = "编号", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java new file mode 100644 index 000000000..b4100c76a --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.member.controller.app.address.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("用户 APP - 用户收件地址更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AppAddressUpdateReqVO extends AppAddressBaseVO { + + @ApiModelProperty(value = "编号", required = true) + @NotNull(message = "编号不能为空") + private Long id; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.http b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.http index b1704f55d..51252530b 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.http +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.http @@ -28,6 +28,17 @@ tenant-id: {{appTenentId}} "code": 9999 } +### 请求 /weixin-mini-app-login 接口 => 成功 +POST {{appApi}}/member/auth/weixin-mini-app-login +Content-Type: application/json +tenant-id: {{appTenentId}} + +{ + "phoneCode": "618e6412e0c728f5b8fc7164497463d0158a923c9e7fd86af8bba393b9decbc5", + "loginCode": "001frTkl21JUf94VGxol2hSlff1frTkR" +} + + ### 请求 /logout 接口 => 成功 POST {{appApi}}/member/auth/logout Content-Type: application/json diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java index 6532f7aca..fadd20733 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java @@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; @@ -43,6 +44,7 @@ public class AppAuthController { } @PostMapping("/logout") + @PermitAll @ApiOperation("登出系统") public CommonResult logout(HttpServletRequest request) { String token = SecurityFrameworkUtils.obtainAuthorization(request, securityProperties.getTokenHeader()); @@ -104,16 +106,16 @@ public class AppAuthController { return CommonResult.success(authService.getSocialAuthorizeUrl(type, redirectUri)); } - @PostMapping("/social-quick-login") + @PostMapping("/social-login") @ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户") - public CommonResult socialQuickLogin(@RequestBody @Valid AppAuthSocialQuickLoginReqVO reqVO) { - return success(authService.socialQuickLogin(reqVO)); + public CommonResult socialLogin(@RequestBody @Valid AppAuthSocialLoginReqVO reqVO) { + return success(authService.socialLogin(reqVO)); } - @PostMapping("/social-bind-login") - @ApiOperation(value = "社交绑定登录,使用 手机号 + 手机验证码", notes = "适合未登录的用户,进行登录 + 绑定") - public CommonResult socialBindLogin(@RequestBody @Valid AppAuthSocialBindLoginReqVO reqVO) { - return success(authService.socialBindLogin(reqVO)); + @PostMapping("/weixin-mini-app-login") + @ApiOperation("微信小程序的一键登录") + public CommonResult weixinMiniAppLogin(@RequestBody @Valid AppAuthWeixinMiniAppLoginReqVO reqVO) { + return success(authService.weixinMiniAppLogin(reqVO)); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java index 1055e979b..d8fe3940f 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -9,9 +12,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; -@ApiModel("用户 APP - 手机 + 密码登录 Request VO") +@ApiModel(value = "用户 APP - 手机 + 密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @@ -28,4 +32,26 @@ public class AppAuthLoginReqVO { @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; + // ========== 绑定社交登录时,需要传递如下参数 ========== + + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @InEnum(SocialTypeEnum.class) + private Integer socialType; + + @ApiModelProperty(value = "授权码", required = true, example = "1024") + private String socialCode; + + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + private String socialState; + + @AssertTrue(message = "授权码不能为空") + public boolean isSocialCodeValid() { + return socialType == null || StrUtil.isNotEmpty(socialCode); + } + + @AssertTrue(message = "授权 state 不能为空") + public boolean isSocialState() { + return socialType == null || StrUtil.isNotEmpty(socialState); + } + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java index 063caf80d..dd6de5d59 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -9,10 +12,11 @@ import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; -@ApiModel("用户 APP - 手机 + 验证码登录 Request VO") +@ApiModel(value = "用户 APP - 手机 + 验证码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @@ -30,4 +34,26 @@ public class AppAuthSmsLoginReqVO { @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") private String code; + // ========== 绑定社交登录时,需要传递如下参数 ========== + + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @InEnum(SocialTypeEnum.class) + private Integer socialType; + + @ApiModelProperty(value = "授权码", required = true, example = "1024") + private String socialCode; + + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + private String socialState; + + @AssertTrue(message = "授权码不能为空") + public boolean isSocialCodeValid() { + return socialType == null || StrUtil.isNotEmpty(socialCode); + } + + @AssertTrue(message = "授权 state 不能为空") + public boolean isSocialState() { + return socialType == null || StrUtil.isNotEmpty(socialState); + } + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialBindLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialBindLoginReqVO.java deleted file mode 100644 index e5c173768..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialBindLoginReqVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.app.auth.vo; - -import cn.iocoder.yudao.framework.common.validation.InEnum; -import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - -@ApiModel("用户 APP - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码") -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class AppAuthSocialBindLoginReqVO { - - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") - @InEnum(SocialTypeEnum.class) - @NotNull(message = "社交平台的类型不能为空") - private Integer type; - - @ApiModelProperty(value = "授权码", required = true, example = "1024") - @NotEmpty(message = "授权码不能为空") - private String code; - - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") - @NotEmpty(message = "state 不能为空") - private String state; - - @ApiModelProperty(value = "手机号", required = true, example = "15119100000") - @NotEmpty(message = "手机号不能为空") - @Length(min = 11, max = 11, message = "手机号是11位数字") - private String mobile; - - @ApiModelProperty(value = "手机验证码", required = true, example = "1024") - @NotEmpty(message = "手机验证码不能为空") - @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") - @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") - private String smsCode; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialQuickLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java similarity index 96% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialQuickLoginReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java index 02c26bcb3..7a5856d67 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialQuickLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java @@ -17,7 +17,7 @@ import javax.validation.constraints.NotNull; @NoArgsConstructor @AllArgsConstructor @Builder -public class AppAuthSocialQuickLoginReqVO { +public class AppAuthSocialLoginReqVO { @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java new file mode 100644 index 000000000..bd34085b2 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.member.controller.app.auth.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotEmpty; + +@ApiModel("用户 APP - 微信小程序手机登录 Request VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class AppAuthWeixinMiniAppLoginReqVO { + + @ApiModelProperty(value = "手机 code", required = true, example = "hello", notes = "小程序通过 wx.getPhoneNumber 方法获得") + @NotEmpty(message = "手机 code 不能为空") + private String phoneCode; + + @ApiModelProperty(value = "登录 code", required = true, example = "word", notes = "小程序通过 wx.login 方法获得") + @NotEmpty(message = "登录 code 不能为空") + private String loginCode; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java index edefcdba0..4eec2893f 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java @@ -40,7 +40,7 @@ public class AppUserController { return success(true); } - @PutMapping("/update-avatar") + @PostMapping("/update-avatar") @ApiOperation("修改用户头像") @PreAuthenticated public CommonResult updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception { diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/address/AddressConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/address/AddressConvert.java new file mode 100644 index 000000000..fdc01e5a8 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/address/AddressConvert.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.member.convert.address; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.member.controller.app.address.vo.*; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; + +/** + * 用户收件地址 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface AddressConvert { + + AddressConvert INSTANCE = Mappers.getMapper(AddressConvert.class); + + AddressDO convert(AppAddressCreateReqVO bean); + + AddressDO convert(AppAddressUpdateReqVO bean); + + AppAddressRespVO convert(AddressDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java index 5a44d76bd..755d71a21 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.member.convert.auth; import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserUnbindReqVO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; @@ -16,8 +16,7 @@ public interface AuthConvert { AuthConvert INSTANCE = Mappers.getMapper(AuthConvert.class); - SocialUserBindReqDTO convert(Long userId, Integer userType, AppAuthSocialBindLoginReqVO reqVO); - SocialUserBindReqDTO convert(Long userId, Integer userType, AppAuthSocialQuickLoginReqVO reqVO); + SocialUserBindReqDTO convert(Long userId, Integer userType, AppAuthSocialLoginReqVO reqVO); SocialUserUnbindReqDTO convert(Long userId, Integer userType, AppSocialUserUnbindReqVO reqVO); SmsCodeSendReqDTO convert(AppAuthSmsSendReqVO reqVO); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java index b72051d63..6be0d6b41 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.member.convert.user; +import cn.iocoder.yudao.module.member.api.user.dto.UserInfoDTO; import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; @@ -14,4 +15,5 @@ public interface UserConvert { AppUserInfoRespVO convert(MemberUserDO bean); UserRespDTO convert2(MemberUserDO bean); + UserInfoDTO convertInfo(MemberUserDO bean); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/AddressDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/AddressDO.java new file mode 100644 index 000000000..546df00c6 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/AddressDO.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.member.dal.dataobject.address; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.member.enums.AddressTypeEnum; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 用户收件地址 DO + * + * @author 芋道源码 + */ +@TableName("member_address") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AddressDO extends BaseDO { + + /** + * 编号 + */ + @TableId + private Long id; + /** + * 用户编号 + */ + private Long userId; + /** + * 收件人名称 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 地区编码 + */ + private Integer areaCode; + /** + * 收件详细地址 + */ + private String detailAddress; + /** + * 地址类型 + * + * 枚举 {@link AddressTypeEnum} + */ + private Integer type; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/package-info.java deleted file mode 100644 index c318d2c94..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.yudao.module.member.dal.dataobject.address; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/address/AddressMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/address/AddressMapper.java new file mode 100644 index 000000000..fc02e5879 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/address/AddressMapper.java @@ -0,0 +1,64 @@ +package cn.iocoder.yudao.module.member.dal.mysql.address; + + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; +import cn.iocoder.yudao.module.member.enums.AddressTypeEnum; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 用户收件地址 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface AddressMapper extends BaseMapperX { + + /** + * 获取当前地址 根据id和userId + * @param userId + * @param id + * @return + */ + default AddressDO getAddressByIdAndUserId(Long userId, Long id) { + QueryWrapperX queryWrapperX = new QueryWrapperX<>(); + queryWrapperX.eq("user_id", userId).eq("id", id); + return selectList(queryWrapperX).stream().findFirst().orElse(null); + } + + /** + * 获取地址列表 + * @param userId + * @param type + * @return + */ + default List selectListByUserIdAndType(Long userId, Integer type) { + QueryWrapperX queryWrapperX = new QueryWrapperX().eq("user_id", userId) + .eqIfPresent("type", type); + return selectList(queryWrapperX); + } + + /** + * 获取默认地址 + * @param userId + * @return + */ + default AddressDO getDefaultUserAddress(Long userId) { + List addressDOList = selectListByUserIdAndType(userId, AddressTypeEnum.DEFAULT.getType()); + return addressDOList.stream().findFirst().orElse(null); + } + + /** + * 获取默认地址 + * @param id + * @param addressTypeEnum + * @return + */ + default int updateTypeById(Long id, AddressTypeEnum addressTypeEnum) { + return updateById(new AddressDO().setId(id).setType(addressTypeEnum.getType())); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/AddressTypeEnum.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/AddressTypeEnum.java new file mode 100644 index 000000000..59465e495 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/AddressTypeEnum.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.member.enums; + +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.Arrays; + +/** + * 用户收件地址的类型枚举 + */ +@Getter +@AllArgsConstructor +public enum AddressTypeEnum implements IntArrayValuable { + + DEFAULT(1, "默认收件地址"), + NORMAL(2, "普通收件地址"), // 即非默认收件地址 + + ; + + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AddressTypeEnum::getType).toArray(); + + private final Integer type; + private final String desc; + + @Override + public int[] array() { + return ARRAYS; + } +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/package-info.java index 02d61331a..7e9ca95de 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/package-info.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/package-info.java @@ -1,5 +1,5 @@ /** - * 属于 system 模块的 framework 封装 + * 属于 member 模块的 framework 封装 * * @author 芋道源码 */ diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/config/SecurityConfiguration.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/config/SecurityConfiguration.java deleted file mode 100644 index c284b35d6..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/config/SecurityConfiguration.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.yudao.module.member.framework.security.config; - -import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; - -/** - * Member 模块的 Security 配置 - */ -@Configuration("memberSecurityConfiguration") -public class SecurityConfiguration { - - @Bean("memberAuthorizeRequestsCustomizer") - public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() { - return new AuthorizeRequestsCustomizer() { - - @Override - public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) { - // 登录的接口 - registry.antMatchers(buildAdminApi("/member/auth/logout")).permitAll(); - } - - }; - } - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/core/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/core/package-info.java deleted file mode 100644 index 3abf5630f..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/security/core/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.yudao.module.member.framework.security.core; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressService.java new file mode 100644 index 000000000..e45b075fe --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressService.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.member.service.address; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.member.controller.app.address.vo.*; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 用户收件地址 Service 接口 + * + * @author 芋道源码 + */ +public interface AddressService { + + /** + * 创建用户收件地址 + * + * + * @param userId 用户编号 + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createAddress(Long userId, @Valid AppAddressCreateReqVO createReqVO); + + /** + * 更新用户收件地址 + * + * @param userId 用户编号 + * @param updateReqVO 更新信息 + */ + void updateAddress(Long userId, @Valid AppAddressUpdateReqVO updateReqVO); + + /** + * 删除用户收件地址 + * + * @param userId 用户编号 + * @param id 编号 + */ + void deleteAddress(Long userId, Long id); + + /** + * 获得用户收件地址 + * + * @param id 编号 + * @return 用户收件地址 + */ + AddressDO getAddress(Long userId, Long id); + + /** + * 获得用户收件地址列表 + * + * @param userId 用户编号 + * @return 用户收件地址列表 + */ + List getAddressList(Long userId); + + AddressDO getDefaultUserAddress(Long userId); +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImpl.java new file mode 100644 index 000000000..a9cd91d59 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImpl.java @@ -0,0 +1,133 @@ +package cn.iocoder.yudao.module.member.service.address; + +import cn.iocoder.yudao.module.member.enums.AddressTypeEnum; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.member.controller.app.address.vo.*; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; + +import cn.iocoder.yudao.module.member.convert.address.AddressConvert; +import cn.iocoder.yudao.module.member.dal.mysql.address.AddressMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; + +/** + * 用户收件地址 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class AddressServiceImpl implements AddressService { + + @Resource + private AddressMapper addressMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public Long createAddress(Long userId, AppAddressCreateReqVO createReqVO) { + // 如果添加的是默认收件地址,则将原默认地址修改为非默认 + if (AddressTypeEnum.DEFAULT.getType().equals(createReqVO.getType())) { + //查询到一个,然后进行 update + List addressDOs = selectListByUserIdAndType(userId, AddressTypeEnum.DEFAULT.getType()); + AddressDO defaultUserAddress = addressMapper.getDefaultUserAddress(userId); + if (!CollectionUtils.isEmpty(addressDOs)) { + addressDOs.forEach(userAddressDO -> addressMapper.updateById(new AddressDO() + .setId(userAddressDO.getId()).setType(AddressTypeEnum.NORMAL.getType()))); + } + Optional.ofNullable(defaultUserAddress) + //更新为非默认 + .ifPresent( u -> addressMapper.updateTypeById(u.getId(), AddressTypeEnum.NORMAL)); + } + // 插入 + AddressDO address = AddressConvert.INSTANCE.convert(createReqVO); + address.setUserId(userId); + addressMapper.insert(address); + // 返回 + return address.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateAddress(Long userId, AppAddressUpdateReqVO updateReqVO) { + // 校验存在,校验是否能够操作 + check(userId, updateReqVO.getId()); + // 如果修改的是默认收件地址,则将原默认地址修改为非默认 + if (AddressTypeEnum.DEFAULT.getType().equals(updateReqVO.getType())) { + //获取默认地址 + AddressDO defaultUserAddress = addressMapper.getDefaultUserAddress(userId); + Optional.ofNullable(defaultUserAddress) + //排除当前地址 + .filter(u -> !u.getId().equals(updateReqVO.getId())) + //更新为非默认 + .ifPresent( u -> addressMapper.updateTypeById(u.getId(), AddressTypeEnum.NORMAL)); + } + // 更新 + AddressDO updateObj = AddressConvert.INSTANCE.convert(updateReqVO); + addressMapper.updateById(updateObj); + } + + @Override + public void deleteAddress(Long userId, Long id) { + // 校验存在,校验是否能够操作 + check(userId, id); + // 删除 + addressMapper.deleteById(id); + } + + /** + * 校验用户收件地址是不是属于该用户 + * + * @param userId 用户编号 + * @param userAddressId 用户收件地址 + */ + private void check(Long userId, Long userAddressId) { + AddressDO addressDO = getAddress(userId, userAddressId); + if(null == addressDO){ + throw exception(ADDRESS_NOT_EXISTS); + } + if (!addressDO.getUserId().equals(userId)) { + throw exception(ADDRESS_FORBIDDEN); + } + } + + @Override + public AddressDO getAddress(Long userId, Long id) { + return addressMapper.getAddressByIdAndUserId(userId, id); + } + + @Override + public List getAddressList(Long userId) { + return selectListByUserIdAndType(userId, null); + } + + /** + * 获取默认地址 + * @param userId + * @return + */ + @Override + public AddressDO getDefaultUserAddress(Long userId) { + return addressMapper.getDefaultUserAddress(userId); + } + + /** + * 根据类型获取地址列表 + * @param userId + * @param type null则查询全部 + * @return + */ + public List selectListByUserIdAndType(Long userId, Integer type) { + return addressMapper.selectListByUserIdAndType(userId, type); + } + + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java index ded192217..6990fba2e 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java @@ -42,15 +42,15 @@ public interface MemberAuthService { * @param reqVO 登录信息 * @return 登录结果 */ - AppAuthLoginRespVO socialQuickLogin(@Valid AppAuthSocialQuickLoginReqVO reqVO); + AppAuthLoginRespVO socialLogin(@Valid AppAuthSocialLoginReqVO reqVO); /** - * 社交登录,使用 手机号 + 手机验证码 + * 微信小程序的一键登录 * * @param reqVO 登录信息 * @return 登录结果 */ - AppAuthLoginRespVO socialBindLogin(@Valid AppAuthSocialBindLoginReqVO reqVO); + AppAuthLoginRespVO weixinMiniAppLogin(AppAuthWeixinMiniAppLoginReqVO reqVO); /** * 获得社交认证 URL @@ -89,4 +89,5 @@ public interface MemberAuthService { * @return 登录结果 */ AppAuthLoginRespVO refreshToken(String refreshToken); + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 5911d81c3..d8c59ad37 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.member.service.auth; +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; @@ -11,17 +13,19 @@ import cn.iocoder.yudao.module.member.convert.auth.AuthConvert; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; import cn.iocoder.yudao.module.member.service.user.MemberUserService; -import cn.iocoder.yudao.module.system.api.auth.OAuth2TokenApi; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCreateReqDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenRespDTO; import cn.iocoder.yudao.module.system.api.logger.LoginLogApi; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; +import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; import cn.iocoder.yudao.module.system.api.social.SocialUserApi; -import cn.iocoder.yudao.module.system.enums.auth.OAuth2ClientConstants; +import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; +import cn.iocoder.yudao.module.system.enums.oauth2.OAuth2ClientConstants; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import com.google.common.annotations.VisibleForTesting; import lombok.extern.slf4j.Slf4j; import org.springframework.security.crypto.password.PasswordEncoder; @@ -55,6 +59,9 @@ public class MemberAuthServiceImpl implements MemberAuthService { @Resource private OAuth2TokenApi oauth2TokenApi; + @Resource + private WxMaService wxMaService; + @Resource private PasswordEncoder passwordEncoder; @Resource @@ -65,6 +72,12 @@ public class MemberAuthServiceImpl implements MemberAuthService { // 使用手机 + 密码,进行登录。 MemberUserDO user = login0(reqVO.getMobile(), reqVO.getPassword()); + // 如果 socialType 非空,说明需要绑定社交用户 + if (reqVO.getSocialType() != null) { + socialUserApi.bindSocialUser(new SocialUserBindReqDTO(user.getId(), getUserType().getValue(), + reqVO.getSocialType(), reqVO.getSocialCode(), reqVO.getSocialState())); + } + // 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(user, reqVO.getMobile(), LoginLogTypeEnum.LOGIN_MOBILE); } @@ -80,12 +93,18 @@ public class MemberAuthServiceImpl implements MemberAuthService { MemberUserDO user = userService.createUserIfAbsent(reqVO.getMobile(), userIp); Assert.notNull(user, "获取用户失败,结果为空"); + // 如果 socialType 非空,说明需要绑定社交用户 + if (reqVO.getSocialType() != null) { + socialUserApi.bindSocialUser(new SocialUserBindReqDTO(user.getId(), getUserType().getValue(), + reqVO.getSocialType(), reqVO.getSocialCode(), reqVO.getSocialState())); + } + // 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(user, reqVO.getMobile(), LoginLogTypeEnum.LOGIN_SMS); } @Override - public AppAuthLoginRespVO socialQuickLogin(AppAuthSocialQuickLoginReqVO reqVO) { + public AppAuthLoginRespVO socialLogin(AppAuthSocialLoginReqVO reqVO) { // 使用 code 授权码,进行登录。然后,获得到绑定的用户编号 Long userId = socialUserApi.getBindUserId(UserTypeEnum.MEMBER.getValue(), reqVO.getType(), reqVO.getCode(), reqVO.getState()); @@ -104,15 +123,24 @@ public class MemberAuthServiceImpl implements MemberAuthService { } @Override - public AppAuthLoginRespVO socialBindLogin(AppAuthSocialBindLoginReqVO reqVO) { - // 使用手机号、手机验证码登录 - AppAuthSmsLoginReqVO loginReqVO = AppAuthSmsLoginReqVO.builder() - .mobile(reqVO.getMobile()).code(reqVO.getSmsCode()).build(); - AppAuthLoginRespVO token = smsLogin(loginReqVO); + public AppAuthLoginRespVO weixinMiniAppLogin(AppAuthWeixinMiniAppLoginReqVO reqVO) { + // 获得对应的手机号信息 + WxMaPhoneNumberInfo phoneNumberInfo; + try { + phoneNumberInfo = wxMaService.getUserService().getNewPhoneNoInfo(reqVO.getPhoneCode()); + } catch (Exception exception) { + throw exception(AUTH_WEIXIN_MINI_APP_PHONE_CODE_ERROR); + } + // 获得获得注册用户 + MemberUserDO user = userService.createUserIfAbsent(phoneNumberInfo.getPurePhoneNumber(), getClientIP()); + Assert.notNull(user, "获取用户失败,结果为空"); // 绑定社交用户 - socialUserApi.bindSocialUser(AuthConvert.INSTANCE.convert(token.getUserId(), getUserType().getValue(), reqVO)); - return token; + socialUserApi.bindSocialUser(new SocialUserBindReqDTO(user.getId(), getUserType().getValue(), + SocialTypeEnum.WECHAT_MINI_APP.getType(), reqVO.getLoginCode(), "")); + + // 创建 Token 令牌,记录登录日志 + return createTokenAfterLoginSuccess(user, user.getMobile(), LoginLogTypeEnum.LOGIN_SOCIAL); } private AppAuthLoginRespVO createTokenAfterLoginSuccess(MemberUserDO user, String mobile, LoginLogTypeEnum logType) { @@ -120,7 +148,8 @@ public class MemberAuthServiceImpl implements MemberAuthService { createLoginLog(user.getId(), mobile, logType, LoginResultEnum.SUCCESS); // 创建 Token 令牌 OAuth2AccessTokenRespDTO accessTokenRespDTO = oauth2TokenApi.createAccessToken(new OAuth2AccessTokenCreateReqDTO() - .setUserId(user.getId()).setUserType(getUserType().getValue()).setClientId(OAuth2ClientConstants.CLIENT_ID_DEFAULT)); + .setUserId(user.getId()).setUserType(getUserType().getValue()) + .setClientId(OAuth2ClientConstants.CLIENT_ID_DEFAULT)); // 构建返回结果 return AuthConvert.INSTANCE.convert(accessTokenRespDTO); } diff --git a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImplTest.java b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImplTest.java new file mode 100644 index 000000000..eefa2e13e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/address/AddressServiceImplTest.java @@ -0,0 +1,160 @@ +package cn.iocoder.yudao.module.member.service.address; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressCreateReqVO; +import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressUpdateReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; +import cn.iocoder.yudao.module.member.dal.mysql.address.AddressMapper; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ADDRESS_NOT_EXISTS; +import static org.junit.jupiter.api.Assertions.*; + +/** +* {@link AddressServiceImpl} 的单元测试类 +* +* @author 芋道源码 +*/ +@Import(AddressServiceImpl.class) +public class AddressServiceImplTest extends BaseDbUnitTest { + + @Resource + private AddressServiceImpl addressService; + + @Resource + private AddressMapper addressMapper; + + @Test + public void testCreateAddress_success() { + // 准备参数 + AppAddressCreateReqVO reqVO = randomPojo(AppAddressCreateReqVO.class); + + // 调用 + Long addressId = addressService.createAddress(getLoginUserId(), reqVO); + // 断言 + assertNotNull(addressId); + // 校验记录的属性是否正确 + AddressDO address = addressMapper.selectById(addressId); + assertPojoEquals(reqVO, address); + } + + @Test + public void testUpdateAddress_success() { + // mock 数据 + AddressDO dbAddress = randomPojo(AddressDO.class); + addressMapper.insert(dbAddress);// @Sql: 先插入出一条存在的数据 + // 准备参数 + AppAddressUpdateReqVO reqVO = randomPojo(AppAddressUpdateReqVO.class, o -> { + o.setId(dbAddress.getId()); // 设置更新的 ID + }); + + // 调用 + addressService.updateAddress(getLoginUserId(), reqVO); + // 校验是否更新正确 + AddressDO address = addressMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, address); + } + + @Test + public void testUpdateAddress_notExists() { + // 准备参数 + AppAddressUpdateReqVO reqVO = randomPojo(AppAddressUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> addressService.updateAddress(getLoginUserId(), reqVO), ADDRESS_NOT_EXISTS); + } + + @Test + public void testDeleteAddress_success() { + // mock 数据 + AddressDO dbAddress = randomPojo(AddressDO.class); + addressMapper.insert(dbAddress);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbAddress.getId(); + + // 调用 + addressService.deleteAddress(getLoginUserId(), id); + // 校验数据不存在了 + assertNull(addressMapper.selectById(id)); + } + + @Test + public void testDeleteAddress_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> addressService.deleteAddress(getLoginUserId(), id), ADDRESS_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void ins() { + // mock 数据 + AddressDO dbAddress = randomPojo(AddressDO.class, o -> { // 等会查询到 + o.setUserId(null); + o.setName(null); + o.setMobile(null); + o.setAreaCode(null); + o.setDetailAddress(null); + o.setType(null); + o.setCreateTime(null); + }); + addressMapper.insert(dbAddress); + // 测试 userId 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setUserId(null))); + // 测试 name 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setName(null))); + // 测试 mobile 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setMobile(null))); + // 测试 areaCode 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setAreaCode(null))); + // 测试 detailAddress 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setDetailAddress(null))); + // 测试 type 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setType(null))); + // 测试 createTime 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setCreateTime(null))); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetAddressList() { + // mock 数据 + AddressDO dbAddress = randomPojo(AddressDO.class, o -> { // 等会查询到 + o.setUserId(null); + o.setName(null); + o.setMobile(null); + o.setAreaCode(null); + o.setDetailAddress(null); + o.setType(null); + o.setCreateTime(null); + }); + addressMapper.insert(dbAddress); + // 测试 userId 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setUserId(null))); + // 测试 name 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setName(null))); + // 测试 mobile 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setMobile(null))); + // 测试 areaCode 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setAreaCode(null))); + // 测试 detailAddress 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setDetailAddress(null))); + // 测试 type 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setType(null))); + // 测试 createTime 不匹配 + addressMapper.insert(cloneIgnoreId(dbAddress, o -> o.setCreateTime(null))); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java index 7218e6f1f..805d06aa6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java +++ b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java @@ -9,7 +9,7 @@ import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthUpdatePasswo import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; import cn.iocoder.yudao.module.member.service.user.MemberUserService; -import cn.iocoder.yudao.module.system.api.auth.OAuth2TokenApi; +import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; import cn.iocoder.yudao.module.system.api.logger.LoginLogApi; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; import cn.iocoder.yudao.module.system.api.social.SocialUserApi; diff --git a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/clean.sql b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/clean.sql index 92f559dc1..bb8eddf50 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/clean.sql @@ -1 +1,2 @@ DELETE FROM "member_user"; +DELETE FROM "member_address"; diff --git a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql index 85925f30b..608a3bddf 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql @@ -30,3 +30,20 @@ CREATE TABLE IF NOT EXISTS "inf_file" ( PRIMARY KEY ("id") ) COMMENT '文件表'; +CREATE TABLE IF NOT EXISTS "member_address" ( + "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint(20) NOT NULL, + "name" varchar(10) NOT NULL, + "mobile" varchar(20) NOT NULL, + "area_code" int(11) NOT NULL, + "detail_address" varchar(250) NOT NULL, + "type" tinyint(4) NOT NULL, + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "creator" varchar(64) DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "updater" varchar(64) DEFAULT '', + "tenant_id" bigint(20) NOT NULL, + PRIMARY KEY ("id") + ) COMMENT '用户收件地址'; + diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java index d228fc3b7..c9b456b90 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.api.dept; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import java.util.Collection; @@ -45,6 +46,9 @@ public interface DeptApi { * @param ids 部门编号数组 * @return 部门 Map */ - Map getDeptMap(Set ids); + default Map getDeptMap(Set ids) { + List list = getDepts(ids); + return CollectionUtils.convertMap(list, DeptRespDTO::getId); + } } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java index 35393a04a..5ba3dfd75 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.api.dict; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; + import java.util.Collection; /** @@ -19,4 +21,22 @@ public interface DictDataApi { */ void validDictDatas(String dictType, Collection values); + /** + * 获得指定的字典数据,从缓存中 + * + * @param type 字典类型 + * @param value 字典数据值 + * @return 字典数据 + */ + DictDataRespDTO getDictData(String type, String value); + + /** + * 解析获得指定的字典数据,从缓存中 + * + * @param type 字典类型 + * @param label 字典数据标签 + * @return 字典数据 + */ + DictDataRespDTO parseDictData(String type, String label); + } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/dto/DictDataRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java similarity index 90% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/dto/DictDataRespDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java index 150ee751e..fe5ab6a21 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/dto/DictDataRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.dict.core.dto; +package cn.iocoder.yudao.module.system.api.dict.dto; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import lombok.Data; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/service/ErrorCodeFrameworkService.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java similarity index 65% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/service/ErrorCodeFrameworkService.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java index 2d93f75f1..7e504490f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/service/ErrorCodeFrameworkService.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java @@ -1,18 +1,18 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.service; +package cn.iocoder.yudao.module.system.api.errorcode; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeAutoGenerateReqDTO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeRespDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import javax.validation.Valid; import java.util.Date; import java.util.List; /** - * 错误码 Framework Service 接口 + * 错误码 Api 接口 * * @author 芋道源码 */ -public interface ErrorCodeFrameworkService { +public interface ErrorCodeApi { /** * 自动创建错误码 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeAutoGenerateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java similarity index 90% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeAutoGenerateReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java index 6f5425869..da4df83ca 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeAutoGenerateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.dto; +package cn.iocoder.yudao.module.system.api.errorcode.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java similarity index 83% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeRespDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java index c0b0cbaa3..1f5a27f8a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/core/dto/ErrorCodeRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.framework.errorcode.core.dto; +package cn.iocoder.yudao.module.system.api.errorcode.dto; import lombok.Data; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApi.java new file mode 100644 index 000000000..802cc0a2b --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.system.api.logger; + +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; + +import javax.validation.Valid; + +/** + * 操作日志 API 接口 + * + * @author 芋道源码 + */ +public interface OperateLogApi { + + /** + * 创建操作日志 + * + * @param createReqDTO 请求 + */ + void createOperateLog(@Valid OperateLogCreateReqDTO createReqDTO); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java new file mode 100644 index 000000000..80161f77f --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java @@ -0,0 +1,123 @@ +package cn.iocoder.yudao.module.system.api.logger.dto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.Map; + +/** + * 操作日志创建 Request DTO + */ +@Data +public class OperateLogCreateReqDTO { + + /** + * 链路追踪编号 + */ + private String traceId; + + /** + * 用户编号 + */ + @NotNull(message = "用户编号不能为空") + private Long userId; + /** + * 用户类型 + */ + @NotNull(message = "用户类型不能为空") + private Integer userType; + + /** + * 操作模块 + */ + @NotEmpty(message = "操作模块不能为空") + private String module; + + /** + * 操作名 + */ + @NotEmpty(message = "操作名") + private String name; + + /** + * 操作分类 + */ + @NotNull(message = "操作分类不能为空") + private Integer type; + + /** + * 操作明细 + */ + private String content; + + /** + * 拓展字段 + */ + private Map exts; + + /** + * 请求方法名 + */ + @NotEmpty(message = "请求方法名不能为空") + private String requestMethod; + + /** + * 请求地址 + */ + @NotEmpty(message = "请求地址不能为空") + private String requestUrl; + + /** + * 用户 IP + */ + @NotEmpty(message = "用户 IP 不能为空") + private String userIp; + + /** + * 浏览器 UserAgent + */ + @NotEmpty(message = "浏览器 UserAgent 不能为空") + private String userAgent; + + /** + * Java 方法名 + */ + @NotEmpty(message = "Java 方法名不能为空") + private String javaMethod; + + /** + * Java 方法的参数 + */ + private String javaMethodArgs; + + /** + * 开始时间 + */ + @NotNull(message = "开始时间不能为空") + private Date startTime; + + /** + * 执行时长,单位:毫秒 + */ + @NotNull(message = "执行时长不能为空") + private Integer duration; + + /** + * 结果码 + */ + @NotNull(message = "结果码不能为空") + private Integer resultCode; + + /** + * 结果提示 + */ + private String resultMsg; + + /** + * 结果数据 + */ + private String resultData; + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java similarity index 77% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApi.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java index 5d0201565..79393cf99 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java @@ -1,8 +1,8 @@ -package cn.iocoder.yudao.module.system.api.auth; +package cn.iocoder.yudao.module.system.api.oauth2; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCheckRespDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCreateReqDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO; import javax.validation.Valid; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCheckRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java similarity index 90% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCheckRespDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java index 5b708ff66..319622ba9 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCheckRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.auth.dto; +package cn.iocoder.yudao.module.system.api.oauth2.dto; import lombok.Data; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCreateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java similarity index 94% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCreateReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java index 1d9b793d3..9257cc9ec 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenCreateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.auth.dto; +package cn.iocoder.yudao.module.system.api.oauth2.dto; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java similarity index 91% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenRespDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java index 768955594..04c0dbe04 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/auth/dto/OAuth2AccessTokenRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.auth.dto; +package cn.iocoder.yudao.module.system.api.oauth2.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java index ccc1c62ae..c591df2c3 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java @@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.system.api.social.dto; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @@ -14,6 +16,8 @@ import javax.validation.constraints.NotNull; * @author 芋道源码 */ @Data +@NoArgsConstructor +@AllArgsConstructor public class SocialUserBindReqDTO { /** @@ -42,7 +46,7 @@ public class SocialUserBindReqDTO { /** * state */ - @NotEmpty(message = "state 不能为空") + @NotNull(message = "state 不能为空") private String state; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java new file mode 100644 index 000000000..3f255d55a --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.system.api.tenant; + +import java.util.List; + +/** + * 多租户的 API 接口 + * + * @author 芋道源码 + */ +public interface TenantApi { + + /** + * 获得所有租户 + * + * @return 租户编号数组 + */ + List getTenantIds(); + + /** + * 校验租户是否合法 + * + * @param id 租户编号 + */ + void validTenant(Long id); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java index d994b0cb3..6c0b7e9d9 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.api.user; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import java.util.Collection; @@ -22,6 +23,14 @@ public interface AdminUserApi { */ AdminUserRespDTO getUser(Long id); + /** + * 通过用户 ID 查询用户们 + * + * @param ids 用户 ID 们 + * @return 用户对象信息 + */ + List getUsers(Collection ids); + /** * 获得指定部门的用户数组 * @@ -44,7 +53,10 @@ public interface AdminUserApi { * @param ids 用户编号数组 * @return 用户 Map */ - Map getUserMap(Collection ids); + default Map getUserMap(Collection ids) { + List users = getUsers(ids); + return CollectionUtils.convertMap(users, AdminUserRespDTO::getId); + } /** * 校验用户们是否有效。如下情况,视为无效: diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2ClientConstants.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2ClientConstants.java similarity index 75% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2ClientConstants.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2ClientConstants.java index e48e132ff..a123d57b9 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2ClientConstants.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2ClientConstants.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.enums.auth; +package cn.iocoder.yudao.module.system.enums.oauth2; /** * OAuth2.0 客户端的通用枚举 diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2GrantTypeEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java similarity index 93% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2GrantTypeEnum.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java index 20eb8fce3..80ce4610b 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/auth/OAuth2GrantTypeEnum.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.enums.auth; +package cn.iocoder.yudao.module.system.enums.oauth2; import cn.hutool.core.util.ArrayUtil; import lombok.AllArgsConstructor; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/social/SocialTypeEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/social/SocialTypeEnum.java index 77833b2e6..197bb2943 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/social/SocialTypeEnum.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/social/SocialTypeEnum.java @@ -6,9 +6,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; import java.util.Arrays; -import java.util.Collection; -import java.util.Set; -import java.util.stream.Collectors; /** * 社交平台的类型枚举 @@ -49,7 +46,7 @@ public enum SocialTypeEnum implements IntArrayValuable { * 微信小程序 * 文档链接:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html */ - WECHAT_MINI_PROGRAM(33, "WECHAT_MINI_PROGRAM"), + WECHAT_MINI_APP(34, "WECHAT_MINI_APP"), ; public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SocialTypeEnum::getType).toArray(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java index 27fbc2f13..5721030bb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -9,8 +9,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.Set; /** * 部门 API 实现类 @@ -40,10 +38,4 @@ public class DeptApiImpl implements DeptApi { deptService.validDepts(ids); } - @Override - public Map getDeptMap(Set ids) { - Map depts = deptService.getDeptMap(ids); - return DeptConvert.INSTANCE.convertMap(depts); - } - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java index 6db4fb8e0..7de1a43b3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java @@ -1,5 +1,8 @@ package cn.iocoder.yudao.module.system.api.dict; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; +import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.service.dict.DictDataService; import org.springframework.stereotype.Service; @@ -22,4 +25,16 @@ public class DictDataApiImpl implements DictDataApi { dictDataService.validDictDatas(dictType, values); } + @Override + public DictDataRespDTO getDictData(String dictType, String value) { + DictDataDO dictData = dictDataService.getDictData(dictType, value); + return DictDataConvert.INSTANCE.convert02(dictData); + } + + @Override + public DictDataRespDTO parseDictData(String dictType, String label) { + DictDataDO dictData = dictDataService.parseDictData(dictType, label); + return DictDataConvert.INSTANCE.convert02(dictData); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java new file mode 100644 index 000000000..895aaebcc --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.system.api.errorcode; + +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; +import cn.iocoder.yudao.module.system.service.errorcode.ErrorCodeService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 错误码 Api 实现类 + * + * @author 芋道源码 + */ +@Service +public class ErrorCodeApiImpl implements ErrorCodeApi { + + @Resource + private ErrorCodeService errorCodeService; + + @Override + public void autoGenerateErrorCodes(List autoGenerateDTOs) { + errorCodeService.autoGenerateErrorCodes(autoGenerateDTOs); + } + + @Override + public List getErrorCodeList(String applicationName, Date minUpdateTime) { + return errorCodeService.getErrorCodeList(applicationName, minUpdateTime); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApiImpl.java new file mode 100644 index 000000000..186f1e098 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/logger/OperateLogApiImpl.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.system.api.logger; + +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; +import cn.iocoder.yudao.module.system.service.logger.OperateLogService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 操作日志 API 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class OperateLogApiImpl implements OperateLogApi { + + @Resource + private OperateLogService operateLogService; + + @Override + public void createOperateLog(OperateLogCreateReqDTO createReqDTO) { + operateLogService.createOperateLog(createReqDTO); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApiImpl.java similarity index 84% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApiImpl.java rename to yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApiImpl.java index 438cf9463..efe4cd5c3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/auth/OAuth2TokenApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApiImpl.java @@ -1,8 +1,8 @@ -package cn.iocoder.yudao.module.system.api.auth; +package cn.iocoder.yudao.module.system.api.oauth2; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCheckRespDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCreateReqDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO; import cn.iocoder.yudao.module.system.convert.auth.OAuth2TokenConvert; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java new file mode 100644 index 000000000..6ea4c795e --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.system.api.tenant; + +import cn.iocoder.yudao.module.system.service.tenant.TenantService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 多租户的 API 实现类 + * + * @author 芋道源码 + */ +@Service +public class TenantApiImpl implements TenantApi { + + @Resource + private TenantService tenantService; + + @Override + public List getTenantIds() { + return tenantService.getTenantIds(); + } + + @Override + public void validTenant(Long id) { + tenantService.validTenant(id); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java index 372e6f5e6..d493b747a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java @@ -9,7 +9,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collection; import java.util.List; -import java.util.Map; import java.util.Set; /** @@ -29,6 +28,12 @@ public class AdminUserApiImpl implements AdminUserApi { return UserConvert.INSTANCE.convert4(user); } + @Override + public List getUsers(Collection ids) { + List users = userService.getUsers(ids); + return UserConvert.INSTANCE.convertList4(users); + } + @Override public List getUsersByDeptIds(Collection deptIds) { List users = userService.getUsersByDeptIds(deptIds); @@ -41,12 +46,6 @@ public class AdminUserApiImpl implements AdminUserApi { return UserConvert.INSTANCE.convertList4(users); } - @Override - public Map getUserMap(Collection ids) { - Map userMap = userService.getUserMap(ids); - return UserConvert.INSTANCE.convertMap4(userMap); - } - @Override public void validUsers(Set ids) { userService.validUsers(ids); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index e42a5dfa5..0a136551f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -27,6 +27,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.List; @@ -59,6 +60,7 @@ public class AuthController { private SecurityProperties securityProperties; @PostMapping("/login") + @PermitAll @ApiOperation("使用账号密码登录") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult login(@RequestBody @Valid AuthLoginReqVO reqVO) { @@ -66,6 +68,7 @@ public class AuthController { } @PostMapping("/logout") + @PermitAll @ApiOperation("登出系统") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult logout(HttpServletRequest request) { @@ -77,6 +80,7 @@ public class AuthController { } @PostMapping("/refresh-token") + @PermitAll @ApiOperation("刷新令牌") @ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @@ -119,6 +123,7 @@ public class AuthController { // ========== 短信登录相关 ========== @PostMapping("/sms-login") + @PermitAll @ApiOperation("使用短信验证码登录") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult smsLogin(@RequestBody @Valid AuthSmsLoginReqVO reqVO) { @@ -126,6 +131,7 @@ public class AuthController { } @PostMapping("/send-sms-code") + @PermitAll @ApiOperation(value = "发送手机验证码") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult sendLoginSmsCode(@RequestBody @Valid AuthSmsSendReqVO reqVO) { @@ -136,28 +142,23 @@ public class AuthController { // ========== 社交登录相关 ========== @GetMapping("/social-auth-redirect") + @PermitAll @ApiOperation("社交授权的跳转") @ApiImplicitParams({ @ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class), @ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class) }) - public CommonResult socialAuthRedirect(@RequestParam("type") Integer type, + public CommonResult socialLogin(@RequestParam("type") Integer type, @RequestParam("redirectUri") String redirectUri) { return CommonResult.success(socialUserService.getAuthorizeUrl(type, redirectUri)); } - @PostMapping("/social-quick-login") - @ApiOperation("社交快捷登录,使用 code 授权码") + @PostMapping("/social-login") + @PermitAll + @ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 - public CommonResult socialQuickLogin(@RequestBody @Valid AuthSocialQuickLoginReqVO reqVO) { - return success(authService.socialQuickLogin(reqVO)); - } - - @PostMapping("/social-bind-login") - @ApiOperation("社交绑定登录,使用 code 授权码 + 账号密码") - @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 - public CommonResult socialBindLogin(@RequestBody @Valid AuthSocialBindLoginReqVO reqVO) { - return success(authService.socialBindLogin(reqVO)); + public CommonResult socialQuickLogin(@RequestBody @Valid AuthSocialLoginReqVO reqVO) { + return success(authService.socialLogin(reqVO)); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java index 0ecd3d670..67e80d24a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java @@ -1,5 +1,8 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -8,10 +11,11 @@ import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; -@ApiModel("管理后台 - 账号密码登录 Request VO") +@ApiModel(value = "管理后台 - 账号密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @@ -29,6 +33,8 @@ public class AuthLoginReqVO { @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; + // ========== 图片验证码相关 ========== + @ApiModelProperty(value = "验证码", required = true, example = "1024", notes = "验证码开启时,需要传递") @NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class) private String code; @@ -37,9 +43,31 @@ public class AuthLoginReqVO { @NotEmpty(message = "唯一标识不能为空", groups = CodeEnableGroup.class) private String uuid; + // ========== 绑定社交登录时,需要传递如下参数 ========== + + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @InEnum(SocialTypeEnum.class) + private Integer socialType; + + @ApiModelProperty(value = "授权码", required = true, example = "1024") + private String socialCode; + + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + private String socialState; + /** * 开启验证码的 Group */ public interface CodeEnableGroup {} + @AssertTrue(message = "授权码不能为空") + public boolean isSocialCodeValid() { + return socialType == null || StrUtil.isNotEmpty(socialCode); + } + + @AssertTrue(message = "授权 state 不能为空") + public boolean isSocialState() { + return socialType == null || StrUtil.isNotEmpty(socialState); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialBindLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialBindLoginReqVO.java deleted file mode 100644 index cefe40d14..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialBindLoginReqVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.yudao.module.system.controller.admin.auth.vo; - -import cn.iocoder.yudao.framework.common.validation.InEnum; -import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - -@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码") -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class AuthSocialBindLoginReqVO { - - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") - @InEnum(SocialTypeEnum.class) - @NotNull(message = "社交平台的类型不能为空") - private Integer type; - - @ApiModelProperty(value = "授权码", required = true, example = "1024") - @NotEmpty(message = "授权码不能为空") - private String code; - - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") - @NotEmpty(message = "state 不能为空") - private String state; - - @ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma") - @NotEmpty(message = "登录账号不能为空") - @Length(min = 4, max = 16, message = "账号长度为 4-16 位") - @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") - private String username; - - @ApiModelProperty(value = "密码", required = true, example = "buzhidao") - @NotEmpty(message = "密码不能为空") - @Length(min = 4, max = 16, message = "密码长度为 4-16 位") - private String password; - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialQuickLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java similarity index 89% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialQuickLoginReqVO.java rename to yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java index 4b7ebb175..e52a49288 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialQuickLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; -import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 社交快捷登录 Request VO,使用 code 授权码") +@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码") @Data @NoArgsConstructor @AllArgsConstructor @Builder -public class AuthSocialQuickLoginReqVO { +public class AuthSocialLoginReqVO { @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/common/CaptchaController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/common/CaptchaController.java index 5fc0b0a6b..546bbde00 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/common/CaptchaController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/common/CaptchaController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -22,6 +23,7 @@ public class CaptchaController { private CaptchaService captchaService; @GetMapping("/get-image") + @PermitAll @ApiOperation("生成图片验证码") public CommonResult getCaptchaImage() { return success(captchaService.getCaptchaImage()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java index e8101f6e9..4b5cc22bf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java @@ -19,7 +19,7 @@ public class LoginLogBaseVO { @NotNull(message = "日志类型不能为空") private Integer logType; - @ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") + @ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") @NotEmpty(message = "链路追踪编号不能为空") private String traceId; @@ -36,8 +36,7 @@ public class LoginLogBaseVO { @NotEmpty(message = "用户 IP 不能为空") private String userIp; - @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") - @NotEmpty(message = "浏览器 UserAgent 不能为空") + @ApiModelProperty(value = "浏览器 UserAgent", example = "Mozilla/5.0") private String userAgent; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java index 17177dadf..fd31ff704 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java @@ -18,8 +18,7 @@ public class LoginLogRespVO extends LoginLogBaseVO { @ApiModelProperty(value = "日志编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户编号", required = true, example = "666") - @NotNull(message = "用户编号不能为空") + @ApiModelProperty(value = "用户编号", example = "666") private Long userId; @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.http b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.http index e11aee721..725a5d4f5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.http +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.http @@ -52,18 +52,3 @@ tenant-id: {{adminTenentId}} POST {{baseUrl}}/system/oauth2/check-token?token=620d307c5b4148df8a98dd6c6c547106 Authorization: Basic ZGVmYXVsdDphZG1pbjEyMw== tenant-id: {{adminTenentId}} - -### 请求 /system/oauth2/user/get 接口 => 成功 -GET {{baseUrl}}/system/oauth2/user/get -Authorization: Bearer 9502bd7a768a4ade920b90f41e2efd5c -tenant-id: {{adminTenentId}} - -### 请求 /system/oauth2/user/update 接口 => 成功 -PUT {{baseUrl}}/system/oauth2/user/update -Content-Type: application/json -Authorization: Bearer 9502bd7a768a4ade920b90f41e2efd5c -tenant-id: {{adminTenentId}} - -{ - "nickname": "芋道源码" -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java index 6034c6096..8ab096587 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; @@ -13,36 +12,27 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAccessTokenRespVO; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAuthorizeInfoRespVO; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenCheckTokenRespVO; -import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user.OAuth2OpenUserInfoRespVO; -import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user.OAuth2OpenUserUpdateReqVO; import cn.iocoder.yudao.module.system.convert.oauth2.OAuth2OpenConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.enums.auth.OAuth2GrantTypeEnum; -import cn.iocoder.yudao.module.system.service.dept.DeptService; -import cn.iocoder.yudao.module.system.service.dept.PostService; +import cn.iocoder.yudao.module.system.enums.oauth2.OAuth2GrantTypeEnum; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ApproveService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ClientService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2GrantService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; -import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.util.oauth2.OAuth2Utils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; import java.util.Collections; import java.util.List; import java.util.Map; @@ -61,7 +51,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti * 另外,一个公司如果有多个管理后台,它们 client_id 产生的 access token 相互之间是无法互通的,即无法访问它们系统的 API 接口,直到两个 client_id 产生信任授权。 * * 考虑到【本系统】暂时不想做的过于复杂,默认只有获取到 access token 之后,可以访问【本系统】管理后台的 /system-api/* 所有接口,除非手动添加 scope 控制。 - * scope 的使用示例,可见当前类的 getUserInfo 和 updateUserInfo 方法,上面有 @PreAuthorize("@ss.hasScope('user.read')") 和 @PreAuthorize("@ss.hasScope('user.write')") 注解 + * scope 的使用示例,可见 {@link OAuth2UserController} 类 * * @author 芋道源码 */ @@ -93,14 +83,17 @@ public class OAuth2OpenController { * 注意,默认需要传递 client_id + client_secret 参数 */ @PostMapping("/token") + @PermitAll @ApiOperation(value = "获得访问令牌", notes = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") @ApiImplicitParams({ @ApiImplicitParam(name = "grant_type", required = true, value = "授权类型", example = "code", dataTypeClass = String.class), @ApiImplicitParam(name = "code", value = "授权范围", example = "userinfo.read", dataTypeClass = String.class), @ApiImplicitParam(name = "redirect_uri", value = "重定向 URI", example = "https://www.iocoder.cn", dataTypeClass = String.class), + @ApiImplicitParam(name = "state", value = "状态", example = "1", dataTypeClass = String.class), @ApiImplicitParam(name = "username", example = "tudou", dataTypeClass = String.class), @ApiImplicitParam(name = "password", example = "cai", dataTypeClass = String.class), // 多个使用空格分隔 - @ApiImplicitParam(name = "scope", example = "user_info", dataTypeClass = String.class) + @ApiImplicitParam(name = "scope", example = "user_info", dataTypeClass = String.class), + @ApiImplicitParam(name = "refresh_token", example = "123424233", dataTypeClass = String.class), }) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult postAccessToken(HttpServletRequest request, @@ -150,6 +143,7 @@ public class OAuth2OpenController { } @DeleteMapping("/token") + @PermitAll @ApiOperation(value = "删除访问令牌") @ApiImplicitParam(name = "token", required = true, value = "访问令牌", example = "biu", dataTypeClass = String.class) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @@ -168,6 +162,7 @@ public class OAuth2OpenController { * 对应 Spring Security OAuth 的 CheckTokenEndpoint 类的 checkToken 方法 */ @PostMapping("/check-token") + @PermitAll @ApiOperation(value = "校验访问令牌") @ApiImplicitParam(name = "token", required = true, value = "访问令牌", example = "biu", dataTypeClass = String.class) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @@ -194,8 +189,7 @@ public class OAuth2OpenController { // 0. 校验用户已经登录。通过 Spring Security 实现 // 1. 获得 Client 客户端的信息 - OAuth2ClientDO client = oauth2ClientService.validOAuthClientFromCache(clientId, null, - null, null, null); + OAuth2ClientDO client = oauth2ClientService.validOAuthClientFromCache(clientId); // 2. 获得用户已经授权的信息 List approves = oauth2ApproveService.getApproveList(getLoginUserId(), getUserType(), clientId); // 拼接返回 @@ -219,8 +213,8 @@ public class OAuth2OpenController { @ApiImplicitParam(name = "client_id", required = true, value = "客户端编号", example = "tudou", dataTypeClass = String.class), @ApiImplicitParam(name = "scope", value = "授权范围", example = "userinfo.read", dataTypeClass = String.class), // 使用 Map 格式,Spring MVC 暂时不支持这么接收参数 @ApiImplicitParam(name = "redirect_uri", required = true, value = "重定向 URI", example = "https://www.iocoder.cn", dataTypeClass = String.class), - @ApiImplicitParam(name = "autoApprove", required = true, value = "用户是否接受", example = "true", dataTypeClass = Boolean.class), - @ApiImplicitParam(name = "state", example = "123321", dataTypeClass = String.class) + @ApiImplicitParam(name = "auto_approve", required = true, value = "用户是否接受", example = "true", dataTypeClass = Boolean.class), + @ApiImplicitParam(name = "state", example = "1", dataTypeClass = String.class) }) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult approveOrDeny(@RequestParam("response_type") String responseType, @@ -232,7 +226,6 @@ public class OAuth2OpenController { @SuppressWarnings("unchecked") Map scopes = JsonUtils.parseObject(scope, Map.class); scopes = ObjectUtil.defaultIfNull(scopes, Collections.emptyMap()); - // TODO 芋艿:针对 approved + scopes 在看看 spring security 的实现 // 0. 校验用户已经登录。通过 Spring Security 实现 // 1.1 校验 responseType 是否满足 code 或者 token 值 @@ -271,7 +264,7 @@ public class OAuth2OpenController { if (StrUtil.equalsAny(responseType, "token")) { return OAuth2GrantTypeEnum.IMPLICIT; } - throw exception0(BAD_REQUEST.getCode(), "response_type 参数值允许 code 和 token"); + throw exception0(BAD_REQUEST.getCode(), "response_type 参数值只允许 code 和 token"); } private String getImplicitGrantRedirect(Long userId, OAuth2ClientDO client, @@ -288,7 +281,7 @@ public class OAuth2OpenController { private String getAuthorizationCodeRedirect(Long userId, OAuth2ClientDO client, List scopes, String redirectUri, String state) { // 1. 创建 code 授权码 - String authorizationCode = oauth2GrantService.grantAuthorizationCodeForCode(userId,getUserType(), client.getClientId(), scopes, + String authorizationCode = oauth2GrantService.grantAuthorizationCodeForCode(userId, getUserType(), client.getClientId(), scopes, redirectUri, state); // 2. 拼接重定向的 URL return OAuth2Utils.buildAuthorizationCodeRedirectUri(redirectUri, authorizationCode, state); @@ -306,43 +299,4 @@ public class OAuth2OpenController { return clientIdAndSecret; } - // ============ 用户操作的示例,展示 scope 的使用 ============ - - @Resource - private AdminUserService userService; - @Resource - private DeptService deptService; - @Resource - private PostService postService; - - @GetMapping("/user/get") - @ApiOperation("获得用户基本信息") - @PreAuthorize("@ss.hasScope('user.read')") - public CommonResult getUserInfo() { - // 获得用户基本信息 - AdminUserDO user = userService.getUser(getLoginUserId()); - OAuth2OpenUserInfoRespVO resp = OAuth2OpenConvert.INSTANCE.convert(user); - // 获得部门信息 - if (user.getDeptId() != null) { - DeptDO dept = deptService.getDept(user.getDeptId()); - resp.setDept(OAuth2OpenConvert.INSTANCE.convert(dept)); - } - // 获得岗位信息 - if (CollUtil.isNotEmpty(user.getPostIds())) { - List posts = postService.getPosts(user.getPostIds()); - resp.setPosts(OAuth2OpenConvert.INSTANCE.convertList(posts)); - } - return success(resp); - } - - @PutMapping("/user/update") - @ApiOperation("更新用户基本信息") - @PreAuthorize("@ss.hasScope('user.write')") - public CommonResult updateUserInfo(@Valid @RequestBody OAuth2OpenUserUpdateReqVO reqVO) { - // 这里将 UserProfileUpdateReqVO =》UserProfileUpdateReqVO 对象,实现接口的复用。 - // 主要是,AdminUserService 没有自己的 BO 对象,所以复用只能这么做 - userService.updateUserProfile(getLoginUserId(), OAuth2OpenConvert.INSTANCE.convert(reqVO)); - return success(true); - } - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.http b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.http new file mode 100644 index 000000000..13c8545bd --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.http @@ -0,0 +1,14 @@ +### 请求 /system/oauth2/user/get 接口 => 成功 +GET {{baseUrl}}/system/oauth2/user/get +Authorization: Bearer 47f9c74ec11041f193b777ebb95c3b0d +tenant-id: {{adminTenentId}} + +### 请求 /system/oauth2/user/update 接口 => 成功 +PUT {{baseUrl}}/system/oauth2/user/update +Content-Type: application/json +Authorization: Bearer 47f9c74ec11041f193b777ebb95c3b0d +tenant-id: {{adminTenentId}} + +{ + "nickname": "芋道源码" +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java new file mode 100644 index 000000000..39b6125ab --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.system.controller.admin.oauth2; + +import cn.hutool.core.collection.CollUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user.OAuth2UserInfoRespVO; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user.OAuth2UserUpdateReqVO; +import cn.iocoder.yudao.module.system.convert.oauth2.OAuth2UserConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.dept.DeptService; +import cn.iocoder.yudao.module.system.service.dept.PostService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; + +/** + * 提供给外部应用调用为主 + * + * 1. 在 getUserInfo 方法上,添加 @PreAuthorize("@ss.hasScope('user.read')") 注解,声明需要满足 scope = user.read + * 2. 在 updateUserInfo 方法上,添加 @PreAuthorize("@ss.hasScope('user.write')") 注解,声明需要满足 scope = user.write + * + * @author 芋道源码 + */ +@Api(tags = "管理后台 - OAuth2.0 用户") +@RestController +@RequestMapping("/system/oauth2/user") +@Validated +@Slf4j +public class OAuth2UserController { + + @Resource + private AdminUserService userService; + @Resource + private DeptService deptService; + @Resource + private PostService postService; + + @GetMapping("/get") + @ApiOperation("获得用户基本信息") + @PreAuthorize("@ss.hasScope('user.read')") // + public CommonResult getUserInfo() { + // 获得用户基本信息 + AdminUserDO user = userService.getUser(getLoginUserId()); + OAuth2UserInfoRespVO resp = OAuth2UserConvert.INSTANCE.convert(user); + // 获得部门信息 + if (user.getDeptId() != null) { + DeptDO dept = deptService.getDept(user.getDeptId()); + resp.setDept(OAuth2UserConvert.INSTANCE.convert(dept)); + } + // 获得岗位信息 + if (CollUtil.isNotEmpty(user.getPostIds())) { + List posts = postService.getPosts(user.getPostIds()); + resp.setPosts(OAuth2UserConvert.INSTANCE.convertList(posts)); + } + return success(resp); + } + + @PutMapping("/update") + @ApiOperation("更新用户基本信息") + @PreAuthorize("@ss.hasScope('user.write')") + public CommonResult updateUserInfo(@Valid @RequestBody OAuth2UserUpdateReqVO reqVO) { + // 这里将 UserProfileUpdateReqVO =》UserProfileUpdateReqVO 对象,实现接口的复用。 + // 主要是,AdminUserService 没有自己的 BO 对象,所以复用只能这么做 + userService.updateUserProfile(getLoginUserId(), OAuth2UserConvert.INSTANCE.convert(reqVO)); + return success(true); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java index b905e302b..f23838718 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java @@ -7,7 +7,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.Set; +import java.util.List; @ApiModel("管理后台 - 【开放接口】校验令牌 Response VO") @Data @@ -28,13 +28,13 @@ public class OAuth2OpenCheckTokenRespVO { @ApiModelProperty(value = "客户端编号", required = true, example = "car") private String clientId; @ApiModelProperty(value = "授权范围", required = true, example = "user_info") - private Set scopes; + private List scopes; @ApiModelProperty(value = "访问令牌", required = true, example = "tudou") @JsonProperty("access_token") private String accessToken; @ApiModelProperty(value = "过期时间", required = true, example = "1593092157", notes = "时间戳 / 1000,即单位:秒") - @JsonProperty("exp") private Long exp; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserInfoRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java similarity index 93% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserInfoRespVO.java rename to yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java index 00df1f11c..ddd7aecc7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserInfoRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user; +package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -8,11 +8,11 @@ import lombok.NoArgsConstructor; import java.util.List; -@ApiModel("管理后台 - 【开放接口】获得用户基本信息 Response VO") +@ApiModel("管理后台 - OAuth2 获得用户基本信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor -public class OAuth2OpenUserInfoRespVO { +public class OAuth2UserInfoRespVO { @ApiModelProperty(value = "用户编号", required = true, example = "1") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java similarity index 89% rename from yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserUpdateReqVO.java rename to yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java index 4c7b784d9..16082a75e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/user/OAuth2OpenUserUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user; +package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -10,11 +10,11 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Email; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 【开放接口】更新用户基本信息 Request VO") +@ApiModel("管理后台 - OAuth2 更新用户基本信息 Request VO") @Data @NoArgsConstructor @AllArgsConstructor -public class OAuth2OpenUserUpdateReqVO { +public class OAuth2UserUpdateReqVO { @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java index a21582cbd..ed32e00cf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -28,6 +29,7 @@ public class SmsCallbackController { private SmsSendService smsSendService; @PostMapping("/yunpian") + @PermitAll @ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档") @ApiImplicitParam(name = "sms_status", value = "发送状态", required = true, example = "[{具体内容}]", dataTypeClass = String.class) @OperateLog(enable = false) @@ -38,6 +40,7 @@ public class SmsCallbackController { } @PostMapping("/aliyun") + @PermitAll @ApiOperation(value = "阿里云短信的回调", notes = "参见 https://help.aliyun.com/document_detail/120998.html 文档") @OperateLog(enable = false) public CommonResult receiveAliyunSmsStatus(HttpServletRequest request) throws Throwable { @@ -47,6 +50,7 @@ public class SmsCallbackController { } @PostMapping("/tencent") + @PermitAll @ApiOperation(value = "腾讯云短信的回调", notes = "参见 https://cloud.tencent.com/document/product/382/52077 文档") @OperateLog(enable = false) public CommonResult receiveTencentSmsStatus(HttpServletRequest request) throws Throwable { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.http b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.http index 3bf59d965..e8213e5cd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.http +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.http @@ -5,7 +5,8 @@ Content-Type: application/json tenant-id: {{adminTenentId}} { - "code": "test_01", + "templateCode": "test_01", + "mobile": "156016913900", "params": { "key01": "value01", "key02": "value02" diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java index 427172b18..acc21d3fa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java @@ -15,6 +15,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; @@ -32,6 +33,7 @@ public class TenantController { private TenantService tenantService; @GetMapping("/get-id-by-name") + @PermitAll @ApiOperation(value = "使用租户名,获得租户编号", notes = "登录界面,根据用户的租户名,获得租户编号") @ApiImplicitParam(name = "name", value = "租户名", required = true, example = "1024", dataTypeClass = Long.class) public CommonResult getTenantIdByName(@RequestParam("name") String name) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java index 62784defa..38e84ea1d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java @@ -65,8 +65,7 @@ public interface AuthConvert { return CollectionUtils.filterList(treeNodeMap.values(), node -> MenuIdEnum.ROOT.getId().equals(node.getParentId())); } - SocialUserBindReqDTO convert(Long userId, Integer userType, AuthSocialBindLoginReqVO reqVO); - SocialUserBindReqDTO convert(Long userId, Integer userType, AuthSocialQuickLoginReqVO reqVO); + SocialUserBindReqDTO convert(Long userId, Integer userType, AuthSocialLoginReqVO reqVO); SmsCodeSendReqDTO convert(AuthSmsSendReqVO reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/OAuth2TokenConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/OAuth2TokenConvert.java index 50a6b977f..17c62f0dd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/OAuth2TokenConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/OAuth2TokenConvert.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.system.convert.auth; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenCheckRespDTO; -import cn.iocoder.yudao.module.system.api.auth.dto.OAuth2AccessTokenRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO; +import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.token.OAuth2AccessTokenRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import org.mapstruct.Mapper; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java index 2a514743b..e8ee7cee7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java @@ -31,6 +31,4 @@ public interface DeptConvert { DeptRespDTO convert03(DeptDO bean); - Map convertMap(Map map); - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java index 215f252e7..89e4d9e06 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.convert.dict; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -29,6 +29,4 @@ public interface DictDataConvert { DictDataRespDTO convert02(DictDataDO bean); - List convertList03(Collection list); - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/errorcode/ErrorCodeConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/errorcode/ErrorCodeConvert.java index 0402aca8b..436cde66d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/errorcode/ErrorCodeConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/errorcode/ErrorCodeConvert.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.system.convert.errorcode; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExcelVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeRespVO; -import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeAutoGenerateReqDTO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/logger/OperateLogConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/logger/OperateLogConvert.java index 21f7a4948..e32ebd091 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/logger/OperateLogConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/logger/OperateLogConvert.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; -import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2OpenConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2OpenConvert.java index 90907d606..fd5100303 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2OpenConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2OpenConvert.java @@ -7,15 +7,9 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAccessTokenRespVO; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAuthorizeInfoRespVO; import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenCheckTokenRespVO; -import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user.OAuth2OpenUserInfoRespVO; -import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.user.OAuth2OpenUserUpdateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.util.oauth2.OAuth2Utils; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -46,14 +40,6 @@ public interface OAuth2OpenConvert { } OAuth2OpenCheckTokenRespVO convert3(OAuth2AccessTokenDO bean); - // ============ 用户操作的示例 ============ - - OAuth2OpenUserInfoRespVO convert(AdminUserDO bean); - OAuth2OpenUserInfoRespVO.Dept convert(DeptDO dept); - List convertList(List list); - - UserProfileUpdateReqVO convert(OAuth2OpenUserUpdateReqVO bean); - default OAuth2OpenAuthorizeInfoRespVO convert(OAuth2ClientDO client, List approves) { // 构建 scopes List> scopes = new ArrayList<>(client.getScopes().size()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2UserConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2UserConvert.java new file mode 100644 index 000000000..b2610565a --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/oauth2/OAuth2UserConvert.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.system.convert.oauth2; + +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user.OAuth2UserInfoRespVO; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user.OAuth2UserUpdateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface OAuth2UserConvert { + + OAuth2UserConvert INSTANCE = Mappers.getMapper(OAuth2UserConvert.class); + + OAuth2UserInfoRespVO convert(AdminUserDO bean); + OAuth2UserInfoRespVO.Dept convert(DeptDO dept); + List convertList(List list); + + UserProfileUpdateReqVO convert(OAuth2UserUpdateReqVO bean); + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java index 2e8a47336..9a2aac3c5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java @@ -14,7 +14,6 @@ import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; -import java.util.Map; @Mapper public interface UserConvert { @@ -53,6 +52,4 @@ public interface UserConvert { List convertList4(List users); - Map convertMap4(Map map); - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java index 8cecb8f1a..5c2340e51 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java @@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; import java.util.Date; import java.util.List; @@ -22,11 +21,10 @@ import java.util.List; * * @author 芋道源码 */ -@TableName("system_oauth2_access_token") +@TableName(value = "system_oauth2_access_token", autoResultMap = true) @KeySequence("system_oauth2_access_token_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) public class OAuth2AccessTokenDO extends TenantBaseDO { /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java index 7264f6c41..721a42e91 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.dal.dataobject.oauth2; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.yudao.module.system.enums.auth.OAuth2GrantTypeEnum; +import cn.iocoder.yudao.module.system.enums.oauth2.OAuth2GrantTypeEnum; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java index a933e1c52..deb7d18aa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java @@ -18,7 +18,7 @@ import java.util.List; * * @author 芋道源码 */ -@TableName("system_oauth2_refresh_token") +@TableName(value = "system_oauth2_refresh_token", autoResultMap = true) // 由于 Oracle 的 SEQ 的名字长度有限制,所以就先用 system_oauth2_access_token_seq 吧,反正也没啥问题 @KeySequence("system_oauth2_access_token_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java index 845f21db9..234c4acca 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java @@ -8,11 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPage import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; import java.util.Arrays; import java.util.Collection; -import java.util.Date; import java.util.List; @Mapper @@ -23,6 +21,11 @@ public interface DictDataMapper extends BaseMapperX { .eq(DictDataDO::getValue, value)); } + default DictDataDO selectByDictTypeAndLabel(String dictType, String label) { + return selectOne(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) + .eq(DictDataDO::getLabel, label)); + } + default List selectByDictTypeAndValues(String dictType, Collection values) { return selectList(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) .in(DictDataDO::getValue, values)); @@ -46,7 +49,4 @@ public interface DictDataMapper extends BaseMapperX { .eqIfPresent(DictDataDO::getStatus, reqVO.getStatus())); } - @Select("SELECT COUNT(*) FROM system_dict_data WHERE update_time > #{maxUpdateTime}") - Long selectCountByUpdateTimeGt(Date maxUpdateTime); - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java index 3c91b4e67..fc250d56a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java @@ -25,7 +25,7 @@ public interface OAuth2AccessTokenMapper extends BaseMapperX() .eqIfPresent(OAuth2AccessTokenDO::getUserId, reqVO.getUserId()) .eqIfPresent(OAuth2AccessTokenDO::getUserType, reqVO.getUserType()) - .eqIfPresent(OAuth2AccessTokenDO::getClientId, reqVO.getClientId()) + .likeIfPresent(OAuth2AccessTokenDO::getClientId, reqVO.getClientId()) .gt(OAuth2AccessTokenDO::getExpiresTime, new Date()) .orderByDesc(OAuth2AccessTokenDO::getId)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/package-info.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/package-info.java deleted file mode 100644 index 012bcb33c..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/errorcode/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * 错误码组件 - * - * 将错误码缓存在内存中,同时通过定时器每 n 分钟更新 - */ -package cn.iocoder.yudao.module.system.framework.errorcode; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/config/SecurityConfiguration.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/config/SecurityConfiguration.java deleted file mode 100644 index 5e47e302e..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/config/SecurityConfiguration.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.yudao.module.system.framework.security.config; - -import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; - -/** - * System 模块的 Security 配置 - * @author kemengkai - */ -@Configuration("systemSecurityConfiguration") -public class SecurityConfiguration { - - @Bean("systemAuthorizeRequestsCustomizer") - public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() { - return new AuthorizeRequestsCustomizer() { - - @Override - public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) { - // 登录的接口 - registry.antMatchers(buildAdminApi("/system/auth/login")).permitAll(); - registry.antMatchers(buildAdminApi("/system/auth/logout")).permitAll(); - registry.antMatchers(buildAdminApi("/system/auth/refresh-token")).permitAll(); - // 社交登陆的接口 - registry.antMatchers(buildAdminApi("/system/auth/social-auth-redirect")).permitAll(); - registry.antMatchers(buildAdminApi("/system/auth/social-quick-login")).permitAll(); - registry.antMatchers(buildAdminApi("/system/auth/social-bind-login")).permitAll(); - // 登录登录的接口 - registry.antMatchers(buildAdminApi("/system/auth/sms-login")).permitAll(); - registry.antMatchers(buildAdminApi("/system/auth/send-sms-code")).permitAll(); - // 验证码的接口 - registry.antMatchers(buildAdminApi("/system/captcha/**")).permitAll(); - // 获得租户编号的接口 - registry.antMatchers(buildAdminApi("/system/tenant/get-id-by-name")).permitAll(); - // 短信回调 API - registry.antMatchers(buildAdminApi("/system/sms/callback/**")).permitAll(); - // OAuth2 API - registry.antMatchers(buildAdminApi("/system/oauth2/token")).permitAll(); - registry.antMatchers(buildAdminApi("/system/oauth2/check-token")).permitAll(); - } - - }; - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/core/package-info.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/core/package-info.java deleted file mode 100644 index 04a8d8b37..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/security/core/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.yudao.module.system.framework.security.core; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/dict/DictDataRefreshConsumer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/dict/DictDataRefreshConsumer.java deleted file mode 100644 index e466f96b2..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/dict/DictDataRefreshConsumer.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.consumer.dict; - -import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; -import cn.iocoder.yudao.module.system.mq.message.dict.DictDataRefreshMessage; -import cn.iocoder.yudao.module.system.service.dict.DictDataService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 针对 {@link DictDataRefreshMessage} 的消费者 - * - * @author 芋道源码 - */ -@Component -@Slf4j -public class DictDataRefreshConsumer extends AbstractChannelMessageListener { - - @Resource - private DictDataService dictDataService; - - @Override - public void onMessage(DictDataRefreshMessage message) { - log.info("[onMessage][收到 DictData 刷新消息]"); - dictDataService.initLocalCache(); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/tenant/TenantRefreshConsumer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/tenant/TenantRefreshConsumer.java deleted file mode 100644 index 5bc008ace..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/tenant/TenantRefreshConsumer.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.consumer.tenant; - -import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; -import cn.iocoder.yudao.module.system.mq.message.tenant.TenantRefreshMessage; -import cn.iocoder.yudao.module.system.service.tenant.TenantService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 针对 {@link cn.iocoder.yudao.module.system.mq.message.tenant.TenantRefreshMessage} 的消费者 - * - * @author 芋道源码 - */ -@Component -@Slf4j -public class TenantRefreshConsumer extends AbstractChannelMessageListener { - - @Resource - private TenantService tenantService; - - @Override - public void onMessage(TenantRefreshMessage message) { - log.info("[onMessage][收到 Tenant 刷新消息]"); - tenantService.initLocalCache(); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/dict/DictDataRefreshMessage.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/dict/DictDataRefreshMessage.java deleted file mode 100644 index 01e5b8605..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/dict/DictDataRefreshMessage.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.message.dict; - -import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 字典数据数据刷新 Message - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class DictDataRefreshMessage extends AbstractChannelMessage { - - @Override - public String getChannel() { - return "system.dict-data.refresh"; - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/tenant/TenantRefreshMessage.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/tenant/TenantRefreshMessage.java deleted file mode 100644 index 19092a4bb..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/tenant/TenantRefreshMessage.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.message.tenant; - -import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 租户数据刷新 Message - * - * @author 芋道源码 - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class TenantRefreshMessage extends AbstractChannelMessage { - - @Override - public String getChannel() { - return "system.tenant.refresh"; - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/dict/DictDataProducer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/dict/DictDataProducer.java deleted file mode 100644 index fa90c8c42..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/dict/DictDataProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.producer.dict; - -import cn.iocoder.yudao.module.system.mq.message.dict.DictDataRefreshMessage; -import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * DictData 字典数据相关消息的 Producer - */ -@Component -public class DictDataProducer { - - @Resource - private RedisMQTemplate redisMQTemplate; - - /** - * 发送 {@link DictDataRefreshMessage} 消息 - */ - public void sendDictDataRefreshMessage() { - DictDataRefreshMessage message = new DictDataRefreshMessage(); - redisMQTemplate.send(message); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/tenant/TenantProducer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/tenant/TenantProducer.java deleted file mode 100644 index eaa9f658d..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/tenant/TenantProducer.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.system.mq.producer.tenant; - -import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate; -import cn.iocoder.yudao.module.system.mq.message.permission.RoleRefreshMessage; -import cn.iocoder.yudao.module.system.mq.message.tenant.TenantRefreshMessage; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Tenant 租户相关消息的 Producer - * - * @author 芋道源码 - */ -@Component -public class TenantProducer { - - @Resource - private RedisMQTemplate redisMQTemplate; - - /** - * 发送 {@link RoleRefreshMessage} 消息 - */ - public void sendTenantRefreshMessage() { - TenantRefreshMessage message = new TenantRefreshMessage(); - redisMQTemplate.send(message); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java index 3a53c1aa3..52796ec2f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java @@ -60,15 +60,7 @@ public interface AdminAuthService { * @param reqVO 登录信息 * @return 登录结果 */ - AuthLoginRespVO socialQuickLogin(@Valid AuthSocialQuickLoginReqVO reqVO); - - /** - * 社交绑定登录,使用 code 授权码 + 账号密码 - * - * @param reqVO 登录信息 - * @return 登录结果 - */ - AuthLoginRespVO socialBindLogin(@Valid AuthSocialBindLoginReqVO reqVO); + AuthLoginRespVO socialLogin(@Valid AuthSocialLoginReqVO reqVO); /** * 刷新访问令牌 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index 03f600110..99e0ff1e6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -8,13 +8,14 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; +import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*; import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.enums.auth.OAuth2ClientConstants; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; +import cn.iocoder.yudao.module.system.enums.oauth2.OAuth2ClientConstants; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; import cn.iocoder.yudao.module.system.service.common.CaptchaService; import cn.iocoder.yudao.module.system.service.logger.LoginLogService; @@ -91,6 +92,12 @@ public class AdminAuthServiceImpl implements AdminAuthService { // 使用账号密码,进行登录 AdminUserDO user = authenticate(reqVO.getUsername(), reqVO.getPassword()); + // 如果 socialType 非空,说明需要绑定社交用户 + if (reqVO.getSocialType() != null) { + socialUserService.bindSocialUser(new SocialUserBindReqDTO(user.getId(), getUserType().getValue(), + reqVO.getSocialType(), reqVO.getSocialCode(), reqVO.getSocialState())); + } + // 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME); } @@ -166,7 +173,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { } @Override - public AuthLoginRespVO socialQuickLogin(AuthSocialQuickLoginReqVO reqVO) { + public AuthLoginRespVO socialLogin(AuthSocialLoginReqVO reqVO) { // 使用 code 授权码,进行登录。然后,获得到绑定的用户编号 Long userId = socialUserService.getBindUserId(UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getCode(), reqVO.getState()); @@ -184,18 +191,6 @@ public class AdminAuthServiceImpl implements AdminAuthService { return createTokenAfterLoginSuccess(user.getId(), user.getUsername(), LoginLogTypeEnum.LOGIN_SOCIAL); } - @Override - public AuthLoginRespVO socialBindLogin(AuthSocialBindLoginReqVO reqVO) { - // 使用账号密码,进行登录。 - AdminUserDO user = authenticate(reqVO.getUsername(), reqVO.getPassword()); - - // 绑定社交用户 - socialUserService.bindSocialUser(AuthConvert.INSTANCE.convert(user.getId(), getUserType().getValue(), reqVO)); - - // 创建 Token 令牌,记录登录日志 - return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_SOCIAL); - } - @Override public AuthLoginRespVO refreshToken(String refreshToken) { OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.refreshAccessToken(refreshToken, OAuth2ClientConstants.CLIENT_ID_DEFAULT); @@ -229,7 +224,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { reqDTO.setTraceId(TracerUtils.getTraceId()); reqDTO.setUserId(userId); reqDTO.setUserType(userType); - if (ObjectUtil.notEqual(getUserType(), userType)) { + if (ObjectUtil.equal(getUserType().getValue(), userType)) { reqDTO.setUsername(getUsername(userId)); } else { reqDTO.setUsername(memberService.getMemberUserMobile(userId)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java index db1a1b624..610fe2a33 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java @@ -1,12 +1,11 @@ package cn.iocoder.yudao.module.system.service.dict; -import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import java.util.Collection; import java.util.List; @@ -16,12 +15,7 @@ import java.util.List; * * @author ruoyi */ -public interface DictDataService extends DictDataFrameworkService { - - /** - * 初始化字典数据的本地缓存 - */ - void initLocalCache(); +public interface DictDataService { /** * 创建字典数据 @@ -94,4 +88,21 @@ public interface DictDataService extends DictDataFrameworkService { */ void validDictDatas(String dictType, Collection values); + /** + * 获得指定的字典数据 + * + * @param dictType 字典类型 + * @param value 字典数据值 + * @return 字典数据 + */ + DictDataDO getDictData(String dictType, String value); + + /** + * 解析获得指定的字典数据,从缓存中 + * + * @param dictType 字典类型 + * @param label 字典数据标签 + * @return 字典数据 + */ + DictDataDO parseDictData(String dictType, String label); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java index 9c38a368b..0cfdb2b99 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; @@ -13,20 +12,15 @@ import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; -import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableTable; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.Collection; import java.util.Comparator; -import java.util.Date; import java.util.List; +import java.util.Map; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; @@ -47,88 +41,12 @@ public class DictDataServiceImpl implements DictDataService { .comparing(DictDataDO::getDictType) .thenComparingInt(DictDataDO::getSort); - /** - * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 - * 因为已经通过 Redis Pub/Sub 机制,所以频率不需要高 - */ - private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; - @Resource private DictTypeService dictTypeService; @Resource private DictDataMapper dictDataMapper; - @Resource - private DictDataProducer dictDataProducer; - - /** - * 字典数据缓存,第二个 key 使用 label - * - * key1:字典类型 dictType - * key2:字典标签 label - */ - private ImmutableTable labelDictDataCache; - /** - * 字典数据缓存,第二个 key 使用 value - * - * key1:字典类型 dictType - * key2:字典值 value - */ - private ImmutableTable valueDictDataCache; - /** - * 缓存字典数据的最大更新时间,用于后续的增量轮询,判断是否有更新 - */ - private volatile Date maxUpdateTime; - - @Override - @PostConstruct - public synchronized void initLocalCache() { - // 获取字典数据列表,如果有更新 - List dataList = loadDictDataIfUpdate(maxUpdateTime); - if (CollUtil.isEmpty(dataList)) { - return; - } - - // 构建缓存 - ImmutableTable.Builder labelDictDataBuilder = ImmutableTable.builder(); - ImmutableTable.Builder valueDictDataBuilder = ImmutableTable.builder(); - dataList.forEach(dictData -> { - labelDictDataBuilder.put(dictData.getDictType(), dictData.getLabel(), dictData); - valueDictDataBuilder.put(dictData.getDictType(), dictData.getValue(), dictData); - }); - labelDictDataCache = labelDictDataBuilder.build(); - valueDictDataCache = valueDictDataBuilder.build(); - maxUpdateTime = CollectionUtils.getMaxValue(dataList, DictDataDO::getUpdateTime); - log.info("[initLocalCache][缓存字典数据,数量为:{}]", dataList.size()); - } - - /** - * 如果字典数据发生变化,从数据库中获取最新的全量字典数据。 - * 如果未发生变化,则返回空 - * - * @param maxUpdateTime 当前字典数据的最大更新时间 - * @return 字典数据列表 - */ - private List loadDictDataIfUpdate(Date maxUpdateTime) { - // 第一步,判断是否要更新。 - if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 - log.info("[loadDictDataIfUpdate][首次加载全量字典数据]"); - } else { // 判断数据库中是否有更新的字典数据 - if (dictDataMapper.selectCountByUpdateTimeGt(maxUpdateTime) == 0) { - return null; - } - log.info("[loadDictDataIfUpdate][增量加载全量字典数据]"); - } - // 第二步,如果有更新,则从数据库加载所有字典数据 - return dictDataMapper.selectList(); - } - - @Scheduled(fixedDelay = SCHEDULER_PERIOD, initialDelay = SCHEDULER_PERIOD) - public void schedulePeriodicRefresh() { - initLocalCache(); - } - @Override public List getDictDatas() { List list = dictDataMapper.selectList(); @@ -153,21 +71,6 @@ public class DictDataServiceImpl implements DictDataService { return dictDataMapper.selectById(id); } - @Override - public DictDataRespDTO getDictDataFromCache(String type, String value) { - return DictDataConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); - } - - @Override - public DictDataRespDTO parseDictDataFromCache(String type, String label) { - return DictDataConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); - } - - @Override - public List listDictDatasFromCache(String type) { - return DictDataConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values()); - } - @Override public Long createDictData(DictDataCreateReqVO reqVO) { // 校验正确性 @@ -176,9 +79,6 @@ public class DictDataServiceImpl implements DictDataService { // 插入字典类型 DictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); dictDataMapper.insert(dictData); - - // 发送刷新消息 - dictDataProducer.sendDictDataRefreshMessage(); return dictData.getId(); } @@ -190,9 +90,6 @@ public class DictDataServiceImpl implements DictDataService { // 更新字典类型 DictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); dictDataMapper.updateById(updateObj); - - // 发送刷新消息 - dictDataProducer.sendDictDataRefreshMessage(); } @Override @@ -202,9 +99,6 @@ public class DictDataServiceImpl implements DictDataService { // 删除字典数据 dictDataMapper.deleteById(id); - - // 发送刷新消息 - dictDataProducer.sendDictDataRefreshMessage(); } @Override @@ -264,7 +158,8 @@ public class DictDataServiceImpl implements DictDataService { if (CollUtil.isEmpty(values)) { return; } - ImmutableMap dictDataMap = valueDictDataCache.row(dictType); + Map dictDataMap = CollectionUtils.convertMap( + dictDataMapper.selectByDictTypeAndValues(dictType, values), DictDataDO::getValue); // 校验 values.forEach(value -> { DictDataDO dictData = dictDataMap.get(value); @@ -277,4 +172,14 @@ public class DictDataServiceImpl implements DictDataService { }); } + @Override + public DictDataDO getDictData(String dictType, String value) { + return dictDataMapper.selectByDictTypeAndValue(dictType, value); + } + + @Override + public DictDataDO parseDictData(String dictType, String label) { + return dictDataMapper.selectByDictTypeAndLabel(dictType, label); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeService.java index 18875f628..8536a262d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeService.java @@ -1,14 +1,16 @@ package cn.iocoder.yudao.module.system.service.errorcode; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.service.ErrorCodeFrameworkService; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; import javax.validation.Valid; +import java.util.Date; import java.util.List; /** @@ -16,7 +18,25 @@ import java.util.List; * * @author 芋道源码 */ -public interface ErrorCodeService extends ErrorCodeFrameworkService { +public interface ErrorCodeService { + + /** + * 自动创建错误码 + * + * @param autoGenerateDTOs 错误码信息 + */ + void autoGenerateErrorCodes(@Valid List autoGenerateDTOs); + + /** + * 增量获得错误码数组 + * + * 如果 minUpdateTime 为空时,则获取所有错误码 + * + * @param applicationName 应用名 + * @param minUpdateTime 最小更新时间 + * @return 错误码数组 + */ + List getErrorCodeList(String applicationName, Date minUpdateTime); /** * 创建错误码 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java index a34f098cd..2997e32ec 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java @@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.system.service.errorcode; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCreateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeAutoGenerateReqDTO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeRespDTO; -import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; +import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; import com.google.common.annotations.VisibleForTesting; @@ -24,9 +24,10 @@ import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_DUPLICATE; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_NOT_EXISTS; /** * 错误码 Service 实现类 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java index 4ec2d8f01..224a83f19 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java @@ -1,7 +1,9 @@ package cn.iocoder.yudao.module.system.service.logger; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.operatelog.core.service.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; @@ -10,8 +12,17 @@ import java.util.List; /** * 操作日志 Service 接口 + * + * @author 芋道源码 */ -public interface OperateLogService extends OperateLogFrameworkService { +public interface OperateLogService { + + /** + * 记录操作日志 + * + * @param createReqDTO 操作日志请求 + */ + void createOperateLog(OperateLogCreateReqDTO createReqDTO); /** * 获得操作日志分页列表 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java index 48f1b5b15..8ae3d139b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java @@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.string.StrUtils; -import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO; import cn.iocoder.yudao.module.system.convert.logger.OperateLogConvert; @@ -13,8 +13,6 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -22,7 +20,6 @@ import javax.annotation.Resource; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.concurrent.Future; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO.JAVA_METHOD_ARGS_MAX_LENGTH; @@ -40,19 +37,11 @@ public class OperateLogServiceImpl implements OperateLogService { private AdminUserService userService; @Override - @Async - public Future createOperateLogAsync(OperateLogCreateReqDTO reqVO) { - boolean success = false; - try { - OperateLogDO logDO = OperateLogConvert.INSTANCE.convert(reqVO); - logDO.setJavaMethodArgs(StrUtils.maxLength(logDO.getJavaMethodArgs(), JAVA_METHOD_ARGS_MAX_LENGTH)); - logDO.setResultData(StrUtils.maxLength(logDO.getResultData(), RESULT_MAX_LENGTH)); - success = operateLogMapper.insert(logDO) == 1; - } catch (Throwable throwable) { - // 仅仅打印日志,不对外抛出。原因是,还是要保留现场数据。 - log.error("[createOperateLogAsync][记录操作日志异常,日志为 ({})]", reqVO, throwable); - } - return new AsyncResult<>(success); + public void createOperateLog(OperateLogCreateReqDTO createReqDTO) { + OperateLogDO logDO = OperateLogConvert.INSTANCE.convert(createReqDTO); + logDO.setJavaMethodArgs(StrUtils.maxLength(logDO.getJavaMethodArgs(), JAVA_METHOD_ARGS_MAX_LENGTH)); + logDO.setResultData(StrUtils.maxLength(logDO.getResultData(), RESULT_MAX_LENGTH)); + operateLogMapper.insert(logDO); } @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImpl.java index b830278c8..9ceb0d3ca 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImpl.java @@ -6,7 +6,9 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2ApproveMapper; +import com.google.common.annotations.VisibleForTesting; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; @@ -35,6 +37,7 @@ public class OAuth2ApproveServiceImpl implements OAuth2ApproveService { private OAuth2ApproveMapper oauth2ApproveMapper; @Override + @Transactional public boolean checkForPreApproval(Long userId, Integer userType, String clientId, Collection requestedScopes) { // 第一步,基于 Client 的自动授权计算,如果 scopes 都在自动授权中,则返回 true 通过 OAuth2ClientDO clientDO = oauth2ClientService.validOAuthClientFromCache(clientId); @@ -49,14 +52,14 @@ public class OAuth2ApproveServiceImpl implements OAuth2ApproveService { } // 第二步,算上用户已经批准的授权。如果 scopes 都包含,则返回 true - List approveDOs = oauth2ApproveMapper.selectListByUserIdAndUserTypeAndClientId( - userId, userType, clientId); + List approveDOs = getApproveList(userId, userType, clientId); Set scopes = convertSet(approveDOs, OAuth2ApproveDO::getScope, - o -> o.getApproved() && !DateUtils.isExpired(o.getExpiresTime())); // 只保留未过期的 + OAuth2ApproveDO::getApproved); // 只保留未过期的 + 同意的 return CollUtil.containsAll(scopes, requestedScopes); } @Override + @Transactional public boolean updateAfterApproval(Long userId, Integer userType, String clientId, Map requestedScopes) { // 如果 requestedScopes 为空,说明没有要求,则返回 true 通过 if (CollUtil.isEmpty(requestedScopes)) { @@ -83,8 +86,9 @@ public class OAuth2ApproveServiceImpl implements OAuth2ApproveService { return approveDOs; } - private void saveApprove(Long userId, Integer userType, String clientId, - String scope, Boolean approved, Date expireTime) { + @VisibleForTesting + void saveApprove(Long userId, Integer userType, String clientId, + String scope, Boolean approved, Date expireTime) { // 先更新 OAuth2ApproveDO approveDO = new OAuth2ApproveDO().setUserId(userId).setUserType(userType) .setClientId(clientId).setScope(scope).setApproved(approved).setExpiresTime(expireTime); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImpl.java index 390282c47..a01cafdbf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImpl.java @@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2ClientMapper; import cn.iocoder.yudao.module.system.mq.producer.auth.OAuth2ClientProducer; import com.google.common.annotations.VisibleForTesting; import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -51,7 +52,8 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService { * * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ - @Getter + @Getter // 解决单测 + @Setter // 解决单测 private volatile Map clientCache; /** * 缓存角色的最大更新时间,用于后续的增量轮询,判断是否有更新 @@ -151,7 +153,7 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService { } @VisibleForTesting - public void validateClientIdExists(Long id, String clientId) { + void validateClientIdExists(Long id, String clientId) { OAuth2ClientDO client = oauth2ClientMapper.selectByClientId(clientId); if (client == null) { return; @@ -160,7 +162,7 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService { if (id == null) { throw exception(OAUTH2_CLIENT_EXISTS); } - if (!client.getClientId().equals(clientId)) { + if (!client.getId().equals(id)) { throw exception(OAUTH2_CLIENT_EXISTS); } } @@ -189,7 +191,7 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService { // 校验客户端密钥 if (StrUtil.isNotEmpty(clientSecret) && ObjectUtil.notEqual(client.getSecret(), clientSecret)) { - throw exception(OAUTH2_CLIENT_CLIENT_SECRET_ERROR, clientSecret); + throw exception(OAUTH2_CLIENT_CLIENT_SECRET_ERROR); } // 校验授权方式 if (StrUtil.isNotEmpty(authorizedGrantType) && !CollUtil.contains(client.getAuthorizedGrantTypes(), authorizedGrantType)) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeService.java index f59671fe9..5ace87eb7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeService.java @@ -26,8 +26,8 @@ public interface OAuth2CodeService { * @param state 状态 * @return 授权码的信息 */ - OAuth2CodeDO createAuthorizationCode(Long userId, Integer userType, String clientId, List scopes, - String redirectUri, String state); + OAuth2CodeDO createAuthorizationCode(Long userId, Integer userType, String clientId, + List scopes, String redirectUri, String state); /** * 使用授权码 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImpl.java index 0dae7692f..c4f72ff32 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImpl.java @@ -33,8 +33,8 @@ public class OAuth2CodeServiceImpl implements OAuth2CodeService { private OAuth2CodeMapper oauth2CodeMapper; @Override - public OAuth2CodeDO createAuthorizationCode(Long userId, Integer userType, String clientId, List scopes, - String redirectUri, String state) { + public OAuth2CodeDO createAuthorizationCode(Long userId, Integer userType, String clientId, + List scopes, String redirectUri, String state) { OAuth2CodeDO codeDO = new OAuth2CodeDO().setCode(generateCode()) .setUserId(userId).setUserType(userType) .setClientId(clientId).setScopes(scopes) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImpl.java index cd253b33c..d68382b75 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImpl.java @@ -76,7 +76,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { // 已过期的情况下,删除刷新令牌 if (DateUtils.isExpired(refreshTokenDO.getExpiresTime())) { - oauth2AccessTokenMapper.deleteById(refreshTokenDO.getId()); + oauth2RefreshTokenMapper.deleteById(refreshTokenDO.getId()); throw exception0(GlobalErrorCodeConstants.UNAUTHORIZED.getCode(), "刷新令牌已过期"); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java index 9c71e8bdb..775c89b58 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java @@ -458,13 +458,16 @@ public class PermissionServiceImpl implements PermissionService { @DataPermission(enable = false) // 关闭数据权限,不然就会出现递归获取数据权限的问题 @TenantIgnore // 忽略多租户的自动过滤。如果不忽略,会导致添加租户时,因为切换租户,导致获取不到 User。即使忽略,本身该方法不存在跨租户的操作,不会存在问题。 public DeptDataPermissionRespDTO getDeptDataPermission(Long userId) { - DeptDataPermissionRespDTO result = new DeptDataPermissionRespDTO(); // 获得用户的角色 Set roleIds = getUserRoleIdsFromCache(userId, singleton(CommonStatusEnum.ENABLE.getStatus())); + // 如果角色为空,则只能查看自己 + DeptDataPermissionRespDTO result = new DeptDataPermissionRespDTO(); if (CollUtil.isEmpty(roleIds)) { + result.setSelf(true); return result; } List roles = roleService.getRolesFromCache(roleIds); + // 获得用户的部门编号的缓存,通过 Guava 的 Suppliers 惰性求值,即有且仅有第一次发起 DB 的查询 Supplier userDeptIdCache = Suppliers.memoize(() -> userService.getUser(userId).getDeptId()); // 遍历每个角色,计算 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java index 608985454..bd2f1d409 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; @@ -40,7 +41,8 @@ public class SmsSendServiceImpl implements SmsSendService { private AdminUserService adminUserService; @Resource private MemberService memberService; - + @Resource + private SmsChannelService smsChannelService; @Resource private SmsTemplateService smsTemplateService; @Resource @@ -80,13 +82,18 @@ public class SmsSendServiceImpl implements SmsSendService { String templateCode, Map templateParams) { // 校验短信模板是否合法 SmsTemplateDO template = this.checkSmsTemplateValid(templateCode); + // 校验短信渠道是否合法 + SmsChannelDO smsChannel = this.checkSmsChannelValid(template.getChannelId()); + // 校验手机号码是否存在 mobile = this.checkMobile(mobile); // 构建有序的模板参数。为什么放在这个位置,是提前保证模板参数的正确性,而不是到了插入发送日志 List> newTemplateParams = this.buildTemplateParams(template, templateParams); // 创建发送日志。如果模板被禁用,则不发送短信,只记录日志 - Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus()); + Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus()) + && CommonStatusEnum.ENABLE.getStatus().equals(smsChannel.getStatus()); + ; String content = smsTemplateService.formatSmsTemplateContent(template.getContent(), templateParams); Long sendLogId = smsLogService.createSmsLog(mobile, userId, userType, isSend, template, content, templateParams); @@ -98,6 +105,16 @@ public class SmsSendServiceImpl implements SmsSendService { return sendLogId; } + @VisibleForTesting + public SmsChannelDO checkSmsChannelValid(Long channelId) { + // 获得短信模板。考虑到效率,从缓存中获取 + SmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); + // 短信模板不存在 + if (channelDO == null) { + throw exception(SMS_SEND_TEMPLATE_NOT_EXISTS); + } + return channelDO; + } @VisibleForTesting public SmsTemplateDO checkSmsTemplateValid(String templateCode) { @@ -112,10 +129,10 @@ public class SmsSendServiceImpl implements SmsSendService { /** * 将参数模板,处理成有序的 KeyValue 数组 - * + *

* 原因是,部分短信平台并不是使用 key 作为参数,而是数组下标,例如说腾讯云 https://cloud.tencent.com/document/product/382/39023 * - * @param template 短信模板 + * @param template 短信模板 * @param templateParams 原始参数 * @return 处理后的参数 */ diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java index 723e507c4..411d749b0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java @@ -3,13 +3,13 @@ package cn.iocoder.yudao.module.system.service.social; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.iocoder.yudao.framework.common.util.http.HttpUtils; +import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserBindDO; import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import com.xkcoding.justauth.AuthRequestFactory; import lombok.extern.slf4j.Slf4j; import me.zhyd.oauth.model.AuthCallback; import me.zhyd.oauth.model.AuthResponse; @@ -39,8 +39,8 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; @Slf4j public class SocialUserServiceImpl implements SocialUserService { - @Resource - private AuthRequestFactory authRequestFactory; + @Resource// 由于自定义了 YudaoAuthRequestFactory 无法覆盖默认的 AuthRequestFactory,所以只能注入它 + private YudaoAuthRequestFactory yudaoAuthRequestFactory; @Resource private SocialUserBindMapper socialUserBindMapper; @@ -50,7 +50,7 @@ public class SocialUserServiceImpl implements SocialUserService { @Override public String getAuthorizeUrl(Integer type, String redirectUri) { // 获得对应的 AuthRequest 实现 - AuthRequest authRequest = authRequestFactory.get(SocialTypeEnum.valueOfType(type).getSource()); + AuthRequest authRequest = yudaoAuthRequestFactory.get(SocialTypeEnum.valueOfType(type).getSource()); // 生成跳转地址 String authorizeUri = authRequest.authorize(AuthStateUtils.createState()); return HttpUtils.replaceUrlQuery(authorizeUri, "redirect_uri", redirectUri); @@ -153,7 +153,7 @@ public class SocialUserServiceImpl implements SocialUserService { * @return 授权的用户 */ private AuthUser getAuthUser(Integer type, String code, String state) { - AuthRequest authRequest = authRequestFactory.get(SocialTypeEnum.valueOfType(type).getSource()); + AuthRequest authRequest = yudaoAuthRequestFactory.get(SocialTypeEnum.valueOfType(type).getSource()); AuthCallback authCallback = AuthCallback.builder().code(code).state(state).build(); AuthResponse authResponse = authRequest.login(authCallback); log.info("[getAuthUser][请求社交平台 type({}) request({}) response({})]", type, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java index 1743991d8..d9d55e9f4 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.service.tenant; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; -import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO; @@ -20,12 +19,7 @@ import java.util.Set; * * @author 芋道源码 */ -public interface TenantService extends TenantFrameworkService { - - /** - * 初始化租户的本地缓存 - */ - void initLocalCache(); +public interface TenantService { /** * 创建租户 @@ -120,4 +114,18 @@ public interface TenantService extends TenantFrameworkService { * @param handler 处理器 */ void handleTenantMenu(TenantMenuHandler handler); + + /** + * 获得所有租户 + * + * @return 租户编号数组 + */ + List getTenantIds(); + + /** + * 校验租户是否合法 + * + * @param id 租户编号 + */ + void validTenant(Long id); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index 160ffe824..dc4a67ef0 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -23,31 +23,25 @@ import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO; import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; -import cn.iocoder.yudao.module.system.mq.producer.tenant.TenantProducer; import cn.iocoder.yudao.module.system.service.permission.MenuService; import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.tenant.handler.TenantInfoHandler; import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.transaction.support.TransactionSynchronization; -import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.validation.annotation.Validated; -import javax.annotation.PostConstruct; import javax.annotation.Resource; -import java.util.*; +import java.util.List; +import java.util.Objects; +import java.util.Set; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertImmutableMap; -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.getMaxValue; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static java.util.Collections.singleton; @@ -61,26 +55,6 @@ import static java.util.Collections.singleton; @Slf4j public class TenantServiceImpl implements TenantService { - /** - * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 - * 因为已经通过 Redis Pub/Sub 机制,所以频率不需要高 - */ - private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; - - /** - * 角色缓存 - * key:角色编号 {@link RoleDO#getId()} - * - * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 - */ - @Getter - private volatile Map tenantCache; - /** - * 缓存角色的最大更新时间,用于后续的增量轮询,判断是否有更新 - */ - @Getter - private volatile Date maxUpdateTime; - @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") @Autowired(required = false) // 由于 yudao.tenant.enable 配置项,可以关闭多租户的功能,所以这里只能不强制注入 private TenantProperties tenantProperties; @@ -100,61 +74,15 @@ public class TenantServiceImpl implements TenantService { @Resource private PermissionService permissionService; - @Resource - private TenantProducer tenantProducer; - - /** - * 初始化 {@link #tenantCache} 缓存 - */ - @Override - @PostConstruct - public void initLocalCache() { - // 获取租户列表,如果有更新 - List tenantList = loadTenantIfUpdate(maxUpdateTime); - if (CollUtil.isEmpty(tenantList)) { - return; - } - - // 写入缓存 - tenantCache = convertImmutableMap(tenantList, TenantDO::getId); - maxUpdateTime = getMaxValue(tenantList, TenantDO::getUpdateTime); - log.info("[initLocalCache][初始化 Tenant 数量为 {}]", tenantList.size()); - } - - @Scheduled(fixedDelay = SCHEDULER_PERIOD, initialDelay = SCHEDULER_PERIOD) - public void schedulePeriodicRefresh() { - initLocalCache(); - } - - /** - * 如果租户发生变化,从数据库中获取最新的全量租户。 - * 如果未发生变化,则返回空 - * - * @param maxUpdateTime 当前租户的最大更新时间 - * @return 租户列表 - */ - private List loadTenantIfUpdate(Date maxUpdateTime) { - // 第一步,判断是否要更新。 - if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 - log.info("[loadTenantIfUpdate][首次加载全量租户]"); - } else { // 判断数据库中是否有更新的租户 - if (tenantMapper.selectCountByUpdateTimeGt(maxUpdateTime) == 0) { - return null; - } - log.info("[loadTenantIfUpdate][增量加载全量租户]"); - } - // 第二步,如果有更新,则从数据库加载所有租户 - return tenantMapper.selectList(); - } - @Override public List getTenantIds() { - return new ArrayList<>(tenantCache.keySet()); + List tenants = tenantMapper.selectList(); + return CollectionUtils.convertList(tenants, TenantDO::getId); } @Override public void validTenant(Long id) { - TenantDO tenant = tenantCache.get(id); + TenantDO tenant = getTenant(id); if (tenant == null) { throw exception(TENANT_NOT_EXISTS); } @@ -184,13 +112,6 @@ public class TenantServiceImpl implements TenantService { // 修改租户的管理员 tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId)); }); - // 发送刷新消息 - TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { - @Override - public void afterCommit() { - tenantProducer.sendTenantRefreshMessage(); - } - }); return tenant.getId(); } @@ -228,13 +149,6 @@ public class TenantServiceImpl implements TenantService { if (ObjectUtil.notEqual(tenant.getPackageId(), updateReqVO.getPackageId())) { updateTenantRoleMenu(tenant.getId(), tenantPackage.getMenuIds()); } - // 发送刷新消息 - TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { - @Override - public void afterCommit() { - tenantProducer.sendTenantRefreshMessage(); - } - }); } @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/util/oauth2/OAuth2Utils.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/util/oauth2/OAuth2Utils.java index 43617ddbe..815bb2c31 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/util/oauth2/OAuth2Utils.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/util/oauth2/OAuth2Utils.java @@ -61,11 +61,13 @@ public class OAuth2Utils { if (CollUtil.isNotEmpty(scopes)) { vars.put("scope", buildScopeStr(scopes)); } - for (String key : additionalInformation.keySet()) { - Object value = additionalInformation.get(key); - if (value != null) { - keys.put("extra_" + key, key); - vars.put("extra_" + key, value); + if (CollUtil.isNotEmpty(additionalInformation)) { + for (String key : additionalInformation.keySet()) { + Object value = additionalInformation.get(key); + if (value != null) { + keys.put("extra_" + key, key); + vars.put("extra_" + key, value); + } } } // Do not include the refresh token (even if there is one) diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenControllerTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenControllerTest.java new file mode 100644 index 000000000..3e6cc282e --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenControllerTest.java @@ -0,0 +1,330 @@ +package cn.iocoder.yudao.module.system.controller.admin.oauth2; + +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.map.MapUtil; +import cn.iocoder.yudao.framework.common.core.KeyValue; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.collection.SetUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAccessTokenRespVO; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAuthorizeInfoRespVO; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open.OAuth2OpenCheckTokenRespVO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; +import cn.iocoder.yudao.module.system.enums.oauth2.OAuth2GrantTypeEnum; +import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ApproveService; +import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ClientService; +import cn.iocoder.yudao.module.system.service.oauth2.OAuth2GrantService; +import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; + +import javax.servlet.http.HttpServletRequest; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * {@link OAuth2OpenController} 的单元测试 + * + * @author 芋道源码 + */ +public class OAuth2OpenControllerTest extends BaseMockitoUnitTest { + + @InjectMocks + private OAuth2OpenController oauth2OpenController; + + @Mock + private OAuth2GrantService oauth2GrantService; + @Mock + private OAuth2ClientService oauth2ClientService; + @Mock + private OAuth2ApproveService oauth2ApproveService; + @Mock + private OAuth2TokenService oauth2TokenService; + + @Test + public void testPostAccessToken_authorizationCode() { + // 准备参数 + String granType = OAuth2GrantTypeEnum.AUTHORIZATION_CODE.getGrantType(); + String code = randomString(); + String redirectUri = randomString(); + String state = randomString(); + HttpServletRequest request = mockRequest("test_client_id", "test_client_secret"); + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("test_client_id"); + when(oauth2ClientService.validOAuthClientFromCache(eq("test_client_id"), eq("test_client_secret"), eq(granType), eq(new ArrayList<>()), eq(redirectUri))).thenReturn(client); + + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofMillis(30050L))); // 多给 10 毫秒,保证可执行完 + when(oauth2GrantService.grantAuthorizationCodeForAccessToken(eq("test_client_id"), + eq(code), eq(redirectUri), eq(state))).thenReturn(accessTokenDO); + + // 调用 + CommonResult result = oauth2OpenController.postAccessToken(request, granType, + code, redirectUri, state, null, null, null, null); + // 断言 + assertEquals(0, result.getCode()); + assertPojoEquals(accessTokenDO, result.getData()); + assertEquals(30L, result.getData().getExpiresIn()); // 执行过程会过去几毫秒 + } + + @Test + public void testPostAccessToken_password() { + // 准备参数 + String granType = OAuth2GrantTypeEnum.PASSWORD.getGrantType(); + String username = randomString(); + String password = randomString(); + String scope = "write read"; + HttpServletRequest request = mockRequest("test_client_id", "test_client_secret"); + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("test_client_id"); + when(oauth2ClientService.validOAuthClientFromCache(eq("test_client_id"), eq("test_client_secret"), + eq(granType), eq(Lists.newArrayList("write", "read")), isNull())).thenReturn(client); + + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofMillis(30050L))); // 多给 10 毫秒,保证可执行完 + when(oauth2GrantService.grantPassword(eq(username), eq(password), eq("test_client_id"), + eq(Lists.newArrayList("write", "read")))).thenReturn(accessTokenDO); + + // 调用 + CommonResult result = oauth2OpenController.postAccessToken(request, granType, + null, null, null, username, password, scope, null); + // 断言 + assertEquals(0, result.getCode()); + assertPojoEquals(accessTokenDO, result.getData()); + assertEquals(30L, result.getData().getExpiresIn()); // 执行过程会过去几毫秒 + } + + @Test + public void testPostAccessToken_refreshToken() { + // 准备参数 + String granType = OAuth2GrantTypeEnum.REFRESH_TOKEN.getGrantType(); + String refreshToken = randomString(); + String password = randomString(); + HttpServletRequest request = mockRequest("test_client_id", "test_client_secret"); + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("test_client_id"); + when(oauth2ClientService.validOAuthClientFromCache(eq("test_client_id"), eq("test_client_secret"), + eq(granType), eq(Lists.newArrayList()), isNull())).thenReturn(client); + + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofMillis(30010L))); // 多给 10 毫秒,保证可执行完 + when(oauth2GrantService.grantRefreshToken(eq(refreshToken), eq("test_client_id"))).thenReturn(accessTokenDO); + + // 调用 + CommonResult result = oauth2OpenController.postAccessToken(request, granType, + null, null, null, null, password, null, refreshToken); + // 断言 + assertEquals(0, result.getCode()); + assertPojoEquals(accessTokenDO, result.getData()); + assertEquals(30L, result.getData().getExpiresIn()); // 执行过程会过去几毫秒 + } + + @Test + public void testPostAccessToken_implicit() { + // 调用,并断言 + assertServiceException(() -> oauth2OpenController.postAccessToken(null, + OAuth2GrantTypeEnum.IMPLICIT.getGrantType(), null, null, null, + null, null, null, null), + new ErrorCode(400, "Token 接口不支持 implicit 授权模式")); + } + + @Test + public void testRevokeToken() { + // 准备参数 + HttpServletRequest request = mockRequest("demo_client_id", "demo_client_secret"); + String token = randomString(); + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("demo_client_id"); + when(oauth2ClientService.validOAuthClientFromCache(eq("demo_client_id"), + eq("demo_client_secret"), isNull(), isNull(), isNull())).thenReturn(client); + // mock 方法(移除) + when(oauth2GrantService.revokeToken(eq("demo_client_id"), eq(token))).thenReturn(true); + + // 调用 + CommonResult result = oauth2OpenController.revokeToken(request, token); + // 断言 + assertEquals(0, result.getCode()); + assertTrue(result.getData()); + } + + @Test + public void testCheckToken() { + // 准备参数 + HttpServletRequest request = mockRequest("demo_client_id", "demo_client_secret"); + String token = randomString(); + // mock 方法 + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class).setUserType(UserTypeEnum.ADMIN.getValue()).setExpiresTime(new Date(1653485731195L)); + when(oauth2TokenService.checkAccessToken(eq(token))).thenReturn(accessTokenDO); + + // 调用 + CommonResult result = oauth2OpenController.checkToken(request, token); + // 断言 + assertEquals(0, result.getCode()); + assertPojoEquals(accessTokenDO, result.getData()); + assertEquals(1653485731L, result.getData().getExp()); // 执行过程会过去几毫秒 + } + + @Test + public void testAuthorize() { + // 准备参数 + String clientId = randomString(); + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("demo_client_id").setScopes(ListUtil.toList("read", "write", "all")); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))).thenReturn(client); + // mock 方法(approve) + List approves = asList( + randomPojo(OAuth2ApproveDO.class).setScope("read").setApproved(true), + randomPojo(OAuth2ApproveDO.class).setScope("write").setApproved(false)); + when(oauth2ApproveService.getApproveList(isNull(), eq(UserTypeEnum.ADMIN.getValue()), eq(clientId))).thenReturn(approves); + + // 调用 + CommonResult result = oauth2OpenController.authorize(clientId); + // 断言 + assertEquals(0, result.getCode()); + assertPojoEquals(client, result.getData().getClient()); + assertEquals(new KeyValue<>("read", true), result.getData().getScopes().get(0)); + assertEquals(new KeyValue<>("write", false), result.getData().getScopes().get(1)); + assertEquals(new KeyValue<>("all", false), result.getData().getScopes().get(2)); + } + + @Test + public void testApproveOrDeny_grantTypeError() { + // 调用,并断言 + assertServiceException(() -> oauth2OpenController.approveOrDeny(randomString(), null, + null, null, null, null), + new ErrorCode(400, "response_type 参数值只允许 code 和 token")); + } + + @Test // autoApprove = true,但是不通过 + public void testApproveOrDeny_autoApproveNo() { + // 准备参数 + String responseType = "code"; + String clientId = randomString(); + String scope = "{\"read\": true, \"write\": false}"; + String redirectUri = randomString(); + String state = randomString(); + // mock 方法 + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId), isNull(), eq("authorization_code"), + eq(asSet("read", "write")), eq(redirectUri))).thenReturn(client); + + // 调用 + CommonResult result = oauth2OpenController.approveOrDeny(responseType, clientId, + scope, redirectUri, true, state); + // 断言 + assertEquals(0, result.getCode()); + assertNull(result.getData()); + } + + @Test // autoApprove = false,但是不通过 + public void testApproveOrDeny_ApproveNo() { + // 准备参数 + String responseType = "token"; + String clientId = randomString(); + String scope = "{\"read\": true, \"write\": false}"; + String redirectUri = "https://www.iocoder.cn"; + String state = "test"; + // mock 方法 + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId), isNull(), eq("implicit"), + eq(asSet("read", "write")), eq(redirectUri))).thenReturn(client); + + // 调用 + CommonResult result = oauth2OpenController.approveOrDeny(responseType, clientId, + scope, redirectUri, false, state); + // 断言 + assertEquals(0, result.getCode()); + assertEquals("https://www.iocoder.cn#error=access_denied&error_description=User%20denied%20access&state=test", result.getData()); + } + + @Test // autoApprove = true,通过 + token + public void testApproveOrDeny_autoApproveWithToken() { + // 准备参数 + String responseType = "token"; + String clientId = randomString(); + String scope = "{\"read\": true, \"write\": false}"; + String redirectUri = "https://www.iocoder.cn"; + String state = "test"; + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId(clientId).setAdditionalInformation(null); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId), isNull(), eq("implicit"), + eq(asSet("read", "write")), eq(redirectUri))).thenReturn(client); + // mock 方法(场景一) + when(oauth2ApproveService.checkForPreApproval(isNull(), eq(UserTypeEnum.ADMIN.getValue()), + eq(clientId), eq(SetUtils.asSet("read", "write")))).thenReturn(true); + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setAccessToken("test_access_token").setExpiresTime(addTime(Duration.ofMillis(30010L))); + when(oauth2GrantService.grantImplicit(isNull(), eq(UserTypeEnum.ADMIN.getValue()), + eq(clientId), eq(ListUtil.toList("read")))).thenReturn(accessTokenDO); + + // 调用 + CommonResult result = oauth2OpenController.approveOrDeny(responseType, clientId, + scope, redirectUri, true, state); + // 断言 + assertEquals(0, result.getCode()); + assertEquals("https://www.iocoder.cn#access_token=test_access_token&token_type=bearer&state=test&expires_in=30&scope=read", result.getData()); + } + + @Test // autoApprove = false,通过 + code + public void testApproveOrDeny_approveWithCode() { + // 准备参数 + String responseType = "code"; + String clientId = randomString(); + String scope = "{\"read\": true, \"write\": false}"; + String redirectUri = "https://www.iocoder.cn"; + String state = "test"; + // mock 方法(client) + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId(clientId).setAdditionalInformation(null); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId), isNull(), eq("authorization_code"), + eq(asSet("read", "write")), eq(redirectUri))).thenReturn(client); + // mock 方法(场景二) + when(oauth2ApproveService.updateAfterApproval(isNull(), eq(UserTypeEnum.ADMIN.getValue()), eq(clientId), + eq(MapUtil.builder(new LinkedHashMap()).put("read", true).put("write", false).build()))) + .thenReturn(true); + // mock 方法(访问令牌) + String authorizationCode = "test_code"; + when(oauth2GrantService.grantAuthorizationCodeForCode(isNull(), eq(UserTypeEnum.ADMIN.getValue()), + eq(clientId), eq(ListUtil.toList("read")), eq(redirectUri), eq(state))).thenReturn(authorizationCode); + + // 调用 + CommonResult result = oauth2OpenController.approveOrDeny(responseType, clientId, + scope, redirectUri, false, state); + // 断言 + assertEquals(0, result.getCode()); + assertEquals("https://www.iocoder.cn?code=test_code&state=test", result.getData()); + } + + private HttpServletRequest mockRequest(String clientId, String secret) { + HttpServletRequest request = mock(HttpServletRequest.class); + when(request.getParameter(eq("client_id"))).thenReturn(clientId); + when(request.getParameter(eq("client_secret"))).thenReturn(secret); + return request; + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java index b20b33aaf..bf38bace1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java @@ -1,36 +1,32 @@ package cn.iocoder.yudao.module.system.service.dict; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; +import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; -import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; -import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import com.google.common.collect.ImmutableTable; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.util.Date; import java.util.List; import java.util.function.Consumer; -import static cn.hutool.core.bean.BeanUtil.getFieldValue; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.when; @Import(DictDataServiceImpl.class) public class DictDataServiceTest extends BaseDbUnitTest { @@ -42,39 +38,6 @@ public class DictDataServiceTest extends BaseDbUnitTest { private DictDataMapper dictDataMapper; @MockBean private DictTypeService dictTypeService; - @MockBean - private DictDataProducer dictDataProducer; - - /** - * 测试加载到新的字典数据的情况 - */ - @Test - @SuppressWarnings("unchecked") - public void testInitLocalCache() { - // mock 数据 - DictDataDO dictData01 = randomDictDataDO(); - dictDataMapper.insert(dictData01); - DictDataDO dictData02 = randomDictDataDO(); - dictDataMapper.insert(dictData02); - - // 调用 - dictDataService.initLocalCache(); - // 断言 labelDictDataCache 缓存 - ImmutableTable labelDictDataCache = - (ImmutableTable) getFieldValue(dictDataService, "labelDictDataCache"); - assertEquals(2, labelDictDataCache.size()); - assertPojoEquals(dictData01, labelDictDataCache.get(dictData01.getDictType(), dictData01.getLabel())); - assertPojoEquals(dictData02, labelDictDataCache.get(dictData02.getDictType(), dictData02.getLabel())); - // 断言 valueDictDataCache 缓存 - ImmutableTable valueDictDataCache = - (ImmutableTable) getFieldValue(dictDataService, "valueDictDataCache"); - assertEquals(2, valueDictDataCache.size()); - assertPojoEquals(dictData01, valueDictDataCache.get(dictData01.getDictType(), dictData01.getValue())); - assertPojoEquals(dictData02, valueDictDataCache.get(dictData02.getDictType(), dictData02.getValue())); - // 断言 maxUpdateTime 缓存 - Date maxUpdateTime = (Date) getFieldValue(dictDataService, "maxUpdateTime"); - assertEquals(ObjectUtils.max(dictData01.getUpdateTime(), dictData02.getUpdateTime()), maxUpdateTime); - } @Test public void testGetDictDataPage() { @@ -148,8 +111,6 @@ public class DictDataServiceTest extends BaseDbUnitTest { // 校验记录的属性是否正确 DictDataDO dictData = dictDataMapper.selectById(dictDataId); assertPojoEquals(reqVO, dictData); - // 校验调用 - verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); } @Test @@ -170,8 +131,6 @@ public class DictDataServiceTest extends BaseDbUnitTest { // 校验是否更新正确 DictDataDO dictData = dictDataMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, dictData); - // 校验调用 - verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); } @Test @@ -186,8 +145,6 @@ public class DictDataServiceTest extends BaseDbUnitTest { dictDataService.deleteDictData(id); // 校验数据不存在了 assertNull(dictDataMapper.selectById(id)); - // 校验调用 - verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); } @Test diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java index 37d542c14..717640525 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java @@ -1,17 +1,17 @@ package cn.iocoder.yudao.module.system.service.errorcode; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; -import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; +import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; -import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -21,12 +21,12 @@ import java.util.List; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_DUPLICATE; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_NOT_EXISTS; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_DUPLICATE; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ERROR_CODE_NOT_EXISTS; import static org.junit.jupiter.api.Assertions.*; @Import(ErrorCodeServiceImpl.class) diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java index 8e6d742c2..f1b043524 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java @@ -7,9 +7,10 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; @@ -17,7 +18,6 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper; import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; @@ -25,8 +25,6 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.Collections; import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; @@ -49,7 +47,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { private AdminUserService userService; @Test - public void testCreateOperateLogAsync() throws InterruptedException, ExecutionException { + public void testCreateOperateLogAsync() { String traceId = TracerUtils.getTraceId(); OperateLogCreateReqDTO reqVO = RandomUtils.randomPojo(OperateLogCreateReqDTO.class, o -> { o.setTraceId(traceId); @@ -59,8 +57,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { }); // 执行service方法 - Future future = operateLogServiceImpl.createOperateLogAsync(reqVO); - future.get(); + operateLogServiceImpl.createOperateLog(reqVO); // 断言插入是否正确 OperateLogDO sysOperateLogDO = operateLogMapper.selectOne("trace_id", traceId); assertPojoEquals(reqVO, sysOperateLogDO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImplTest.java new file mode 100644 index 000000000..a9ea70ff4 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ApproveServiceImplTest.java @@ -0,0 +1,267 @@ +package cn.iocoder.yudao.module.system.service.oauth2; + +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; +import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2ApproveMapper; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.time.Duration; +import java.util.*; + +import static cn.hutool.core.util.RandomUtil.*; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +/** + * {@link OAuth2ApproveServiceImpl} 的单元测试类 + * + * @author 芋道源码 + */ +@Import(OAuth2ApproveServiceImpl.class) +public class OAuth2ApproveServiceImplTest extends BaseDbUnitTest { + + @Resource + private OAuth2ApproveServiceImpl oauth2ApproveService; + + @Resource + private OAuth2ApproveMapper oauth2ApproveMapper; + + @MockBean + private OAuth2ClientService oauth2ClientService; + + @Test + public void checkForPreApproval_clientAutoApprove() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List requestedScopes = Lists.newArrayList("read"); + // mock 方法 + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))) + .thenReturn(randomPojo(OAuth2ClientDO.class).setAutoApproveScopes(requestedScopes)); + + // 调用 + boolean success = oauth2ApproveService.checkForPreApproval(userId, userType, + clientId, requestedScopes); + // 断言 + assertTrue(success); + List result = oauth2ApproveMapper.selectList(); + assertEquals(1, result.size()); + assertEquals(userId, result.get(0).getUserId()); + assertEquals(userType, result.get(0).getUserType()); + assertEquals(clientId, result.get(0).getClientId()); + assertEquals("read", result.get(0).getScope()); + assertTrue(result.get(0).getApproved()); + assertFalse(DateUtils.isExpired(result.get(0).getExpiresTime())); + } + + @Test + public void checkForPreApproval_approve() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List requestedScopes = Lists.newArrayList("read"); + // mock 方法 + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))) + .thenReturn(randomPojo(OAuth2ClientDO.class).setAutoApproveScopes(null)); + // mock 数据 + OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class).setUserId(userId) + .setUserType(userType).setClientId(clientId).setScope("read") + .setExpiresTime(addTime(Duration.ofDays(1))).setApproved(true); // 同意 + oauth2ApproveMapper.insert(approve); + + // 调用 + boolean success = oauth2ApproveService.checkForPreApproval(userId, userType, + clientId, requestedScopes); + // 断言 + assertTrue(success); + } + + @Test + public void checkForPreApproval_reject() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List requestedScopes = Lists.newArrayList("read"); + // mock 方法 + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))) + .thenReturn(randomPojo(OAuth2ClientDO.class).setAutoApproveScopes(null)); + // mock 数据 + OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class).setUserId(userId) + .setUserType(userType).setClientId(clientId).setScope("read") + .setExpiresTime(addTime(Duration.ofDays(1))).setApproved(false); // 拒绝 + oauth2ApproveMapper.insert(approve); + + // 调用 + boolean success = oauth2ApproveService.checkForPreApproval(userId, userType, + clientId, requestedScopes); + // 断言 + assertFalse(success); + } + + @Test + public void testUpdateAfterApproval_none() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + + // 调用 + boolean success = oauth2ApproveService.updateAfterApproval(userId, userType, clientId, + null); + // 断言 + assertTrue(success); + List result = oauth2ApproveMapper.selectList(); + assertEquals(0, result.size()); + } + + @Test + public void testUpdateAfterApproval_approved() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + Map requestedScopes = new LinkedHashMap<>(); // 有序,方便判断 + requestedScopes.put("read", true); + requestedScopes.put("write", false); + // mock 方法 + + // 调用 + boolean success = oauth2ApproveService.updateAfterApproval(userId, userType, clientId, + requestedScopes); + // 断言 + assertTrue(success); + List result = oauth2ApproveMapper.selectList(); + assertEquals(2, result.size()); + // read + assertEquals(userId, result.get(0).getUserId()); + assertEquals(userType, result.get(0).getUserType()); + assertEquals(clientId, result.get(0).getClientId()); + assertEquals("read", result.get(0).getScope()); + assertTrue(result.get(0).getApproved()); + assertFalse(DateUtils.isExpired(result.get(0).getExpiresTime())); + // write + assertEquals(userId, result.get(1).getUserId()); + assertEquals(userType, result.get(1).getUserType()); + assertEquals(clientId, result.get(1).getClientId()); + assertEquals("write", result.get(1).getScope()); + assertFalse(result.get(1).getApproved()); + assertFalse(DateUtils.isExpired(result.get(1).getExpiresTime())); + } + + @Test + public void testUpdateAfterApproval_reject() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + Map requestedScopes = new LinkedHashMap<>(); + requestedScopes.put("write", false); + // mock 方法 + + // 调用 + boolean success = oauth2ApproveService.updateAfterApproval(userId, userType, clientId, + requestedScopes); + // 断言 + assertFalse(success); + List result = oauth2ApproveMapper.selectList(); + assertEquals(1, result.size()); + // write + assertEquals(userId, result.get(0).getUserId()); + assertEquals(userType, result.get(0).getUserType()); + assertEquals(clientId, result.get(0).getClientId()); + assertEquals("write", result.get(0).getScope()); + assertFalse(result.get(0).getApproved()); + assertFalse(DateUtils.isExpired(result.get(0).getExpiresTime())); + } + + @Test + public void testGetApproveList() { + // 准备参数 + Long userId = 10L; + Integer userType = UserTypeEnum.ADMIN.getValue(); + String clientId = randomString(); + // mock 数据 + OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class).setUserId(userId) + .setUserType(userType).setClientId(clientId).setExpiresTime(addTime(Duration.ofDays(1L))); + oauth2ApproveMapper.insert(approve); // 未过期 + oauth2ApproveMapper.insert(ObjectUtil.clone(approve).setId(null) + .setExpiresTime(addTime(Duration.ofDays(-1L)))); // 已过期 + + // 调用 + List result = oauth2ApproveService.getApproveList(userId, userType, clientId); + // 断言 + assertEquals(1, result.size()); + assertPojoEquals(approve, result.get(0)); + } + + @Test + public void testSaveApprove_insert() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + String scope = randomString(); + Boolean approved = randomBoolean(); + Date expireTime = randomDay(1, 30); + // mock 方法 + + // 调用 + oauth2ApproveService.saveApprove(userId, userType, clientId, + scope, approved, expireTime); + // 断言 + List result = oauth2ApproveMapper.selectList(); + assertEquals(1, result.size()); + assertEquals(userId, result.get(0).getUserId()); + assertEquals(userType, result.get(0).getUserType()); + assertEquals(clientId, result.get(0).getClientId()); + assertEquals(scope, result.get(0).getScope()); + assertEquals(approved, result.get(0).getApproved()); + assertEquals(expireTime, result.get(0).getExpiresTime()); + } + + @Test + public void testSaveApprove_update() { + // mock 数据 + OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class); + oauth2ApproveMapper.insert(approve); + // 准备参数 + Long userId = approve.getUserId(); + Integer userType = approve.getUserType(); + String clientId = approve.getClientId(); + String scope = approve.getScope(); + Boolean approved = randomBoolean(); + Date expireTime = randomDay(1, 30); + // mock 方法 + + // 调用 + oauth2ApproveService.saveApprove(userId, userType, clientId, + scope, approved, expireTime); + // 断言 + List result = oauth2ApproveMapper.selectList(); + assertEquals(1, result.size()); + assertEquals(approve.getId(), result.get(0).getId()); + assertEquals(userId, result.get(0).getUserId()); + assertEquals(userType, result.get(0).getUserType()); + assertEquals(clientId, result.get(0).getClientId()); + assertEquals(scope, result.get(0).getScope()); + assertEquals(approved, result.get(0).getApproved()); + assertEquals(expireTime, result.get(0).getExpiresTime()); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/OAuth2ClientServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java similarity index 66% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/OAuth2ClientServiceImplTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java index ef10f2419..c7d4ce578 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/OAuth2ClientServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java @@ -1,5 +1,6 @@ -package cn.iocoder.yudao.module.system.service.auth; +package cn.iocoder.yudao.module.system.service.oauth2; +import cn.hutool.core.map.MapUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; @@ -9,13 +10,12 @@ import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client.OAuth2Cl import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2ClientMapper; import cn.iocoder.yudao.module.system.mq.producer.auth.OAuth2ClientProducer; -import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ClientServiceImpl; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Collections; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; @@ -23,7 +23,7 @@ import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.OAUTH2_CLIENT_NOT_EXISTS; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.verify; @@ -132,7 +132,31 @@ public class OAuth2ClientServiceImplTest extends BaseDbUnitTest { } @Test - @Disabled + public void testValidateClientIdExists_withId() { + // mock 数据 + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("tudou"); + oauth2ClientMapper.insert(client); + // 准备参数 + Long id = randomLongId(); + String clientId = "tudou"; + + // 调用,不会报错 + assertServiceException(() -> oauth2ClientService.validateClientIdExists(id, clientId), OAUTH2_CLIENT_EXISTS); + } + + @Test + public void testValidateClientIdExists_noId() { + // mock 数据 + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("tudou"); + oauth2ClientMapper.insert(client); + // 准备参数 + String clientId = "tudou"; + + // 调用,不会报错 + assertServiceException(() -> oauth2ClientService.validateClientIdExists(null, clientId), OAUTH2_CLIENT_EXISTS); + } + + @Test public void testGetOAuth2ClientPage() { // mock 数据 OAuth2ClientDO dbOAuth2Client = randomPojo(OAuth2ClientDO.class, o -> { // 等会查询到 @@ -143,10 +167,10 @@ public class OAuth2ClientServiceImplTest extends BaseDbUnitTest { // 测试 name 不匹配 oauth2ClientMapper.insert(cloneIgnoreId(dbOAuth2Client, o -> o.setName("凤凰"))); // 测试 status 不匹配 - oauth2ClientMapper.insert(cloneIgnoreId(dbOAuth2Client, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()))); + oauth2ClientMapper.insert(cloneIgnoreId(dbOAuth2Client, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 准备参数 OAuth2ClientPageReqVO reqVO = new OAuth2ClientPageReqVO(); - reqVO.setName("long"); + reqVO.setName("龙"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 @@ -157,4 +181,35 @@ public class OAuth2ClientServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbOAuth2Client, pageResult.getList().get(0)); } + @Test + public void testValidOAuthClientFromCache() { + // mock 方法 + OAuth2ClientDO client = randomPojo(OAuth2ClientDO.class).setClientId("default") + .setStatus(CommonStatusEnum.ENABLE.getStatus()); + OAuth2ClientDO client02 = randomPojo(OAuth2ClientDO.class).setClientId("disable") + .setStatus(CommonStatusEnum.DISABLE.getStatus()); + Map clientCache = MapUtil.builder() + .put(client.getClientId(), client) + .put(client02.getClientId(), client02).build(); + oauth2ClientService.setClientCache(clientCache); + + // 调用,并断言 + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache(randomString(), + null, null, null, null), OAUTH2_CLIENT_NOT_EXISTS); + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("disable", + null, null, null, null), OAUTH2_CLIENT_DISABLE); + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("default", + randomString(), null, null, null), OAUTH2_CLIENT_CLIENT_SECRET_ERROR); + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("default", + null, randomString(), null, null), OAUTH2_CLIENT_AUTHORIZED_GRANT_TYPE_NOT_EXISTS); + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("default", + null, null, Collections.singleton(randomString()), null), OAUTH2_CLIENT_SCOPE_OVER); + assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("default", + null, null, null, "test"), OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH, "test"); + // 成功调用 + OAuth2ClientDO result = oauth2ClientService.validOAuthClientFromCache(client.getClientId(), client.getSecret(), + client.getAuthorizedGrantTypes().get(0), client.getScopes(), client.getRedirectUris().get(0)); + assertPojoEquals(client, result); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImplTest.java new file mode 100644 index 000000000..667490251 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImplTest.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.system.service.oauth2; + +import cn.hutool.core.util.RandomUtil; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2CodeDO; +import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2CodeMapper; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.Test; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.time.Duration; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.OAUTH2_CODE_EXPIRE; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.OAUTH2_CODE_NOT_EXISTS; +import static org.junit.jupiter.api.Assertions.*; + +/** + * {@link OAuth2CodeServiceImpl} 的单元测试类 + * + * @author 芋道源码 + */ +@Import(OAuth2CodeServiceImpl.class) +class OAuth2CodeServiceImplTest extends BaseDbUnitTest { + + @Resource + private OAuth2CodeServiceImpl oauth2CodeService; + + @Resource + private OAuth2CodeMapper oauth2CodeMapper; + + @Test + public void testCreateAuthorizationCode() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = RandomUtil.randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List scopes = Lists.newArrayList("read", "write"); + String redirectUri = randomString(); + String state = randomString(); + + // 调用 + OAuth2CodeDO codeDO = oauth2CodeService.createAuthorizationCode(userId, userType, clientId, + scopes, redirectUri, state); + // 断言 + OAuth2CodeDO dbCodeDO = oauth2CodeMapper.selectByCode(codeDO.getCode()); + assertPojoEquals(codeDO, dbCodeDO, "createTime", "updateTime", "deleted"); + assertEquals(userId, codeDO.getUserId()); + assertEquals(userType, codeDO.getUserType()); + assertEquals(clientId, codeDO.getClientId()); + assertEquals(scopes, codeDO.getScopes()); + assertEquals(redirectUri, codeDO.getRedirectUri()); + assertEquals(state, codeDO.getState()); + assertFalse(DateUtils.isExpired(codeDO.getExpiresTime())); + } + + @Test + public void testConsumeAuthorizationCode_null() { + // 调用,并断言 + assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(randomString()), + OAUTH2_CODE_NOT_EXISTS); + } + + @Test + public void testConsumeAuthorizationCode_expired() { + // 准备参数 + String code = "test_code"; + // mock 数据 + OAuth2CodeDO codeDO = randomPojo(OAuth2CodeDO.class).setCode(code) + .setExpiresTime(addTime(Duration.ofDays(-1))); + oauth2CodeMapper.insert(codeDO); + + // 调用,并断言 + assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(code), + OAUTH2_CODE_EXPIRE); + } + + @Test + public void testConsumeAuthorizationCode_success() { + // 准备参数 + String code = "test_code"; + // mock 数据 + OAuth2CodeDO codeDO = randomPojo(OAuth2CodeDO.class).setCode(code) + .setExpiresTime(addTime(Duration.ofDays(1))); + oauth2CodeMapper.insert(codeDO); + + // 调用 + OAuth2CodeDO result = oauth2CodeService.consumeAuthorizationCode(code); + assertPojoEquals(codeDO, result); + assertNull(oauth2CodeMapper.selectByCode(code)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java new file mode 100644 index 000000000..944086671 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java @@ -0,0 +1,165 @@ +package cn.iocoder.yudao.module.system.service.oauth2; + +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2CodeDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; +import com.google.common.collect.Lists; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; + +import java.util.List; + +import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +/** + * {@link OAuth2GrantServiceImpl} 的单元测试 + * + * @author 芋道源码 + */ +public class OAuth2GrantServiceImplTest extends BaseMockitoUnitTest { + + @InjectMocks + private OAuth2GrantServiceImpl oauth2GrantService; + + @Mock + private OAuth2TokenService oauth2TokenService; + @Mock + private OAuth2CodeService oauth2CodeService; + @Mock + private AdminAuthService adminAuthService; + + @Test + public void testGrantImplicit() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List scopes = Lists.newArrayList("read", "write"); + // mock 方法 + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.createAccessToken(eq(userId), eq(userType), + eq(clientId), eq(scopes))).thenReturn(accessTokenDO); + + // 调用,并断言 + assertPojoEquals(accessTokenDO, oauth2GrantService.grantImplicit( + userId, userType, clientId, scopes)); + } + + @Test + public void testGrantAuthorizationCodeForCode() { + // 准备参数 + Long userId = randomLongId(); + Integer userType = randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List scopes = Lists.newArrayList("read", "write"); + String redirectUri = randomString(); + String state = randomString(); + // mock 方法 + OAuth2CodeDO codeDO = randomPojo(OAuth2CodeDO.class); + when(oauth2CodeService.createAuthorizationCode(eq(userId), eq(userType), + eq(clientId), eq(scopes), eq(redirectUri), eq(state))).thenReturn(codeDO); + + // 调用,并断言 + assertEquals(codeDO.getCode(), oauth2GrantService.grantAuthorizationCodeForCode(userId, userType, + clientId, scopes, redirectUri, state)); + } + + @Test + public void testGrantAuthorizationCodeForAccessToken() { + // 准备参数 + String clientId = randomString(); + String code = randomString(); + List scopes = Lists.newArrayList("read", "write"); + String redirectUri = randomString(); + String state = randomString(); + // mock 方法(code) + OAuth2CodeDO codeDO = randomPojo(OAuth2CodeDO.class, o -> { + o.setClientId(clientId); + o.setRedirectUri(redirectUri); + o.setState(state); + o.setScopes(scopes); + }); + when(oauth2CodeService.consumeAuthorizationCode(eq(code))).thenReturn(codeDO); + // mock 方法(创建令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.createAccessToken(eq(codeDO.getUserId()), eq(codeDO.getUserType()), + eq(codeDO.getClientId()), eq(codeDO.getScopes()))).thenReturn(accessTokenDO); + + // 调用,并断言 + assertPojoEquals(accessTokenDO, oauth2GrantService.grantAuthorizationCodeForAccessToken( + clientId, code, redirectUri, state)); + } + + @Test + public void testGrantPassword() { + // 准备参数 + String username = randomString(); + String password = randomString(); + String clientId = randomString(); + List scopes = Lists.newArrayList("read", "write"); + // mock 方法(认证) + AdminUserDO user = randomPojo(AdminUserDO.class); + when(adminAuthService.authenticate(eq(username), eq(password))).thenReturn(user); + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.createAccessToken(eq(user.getId()), eq(UserTypeEnum.ADMIN.getValue()), + eq(clientId), eq(scopes))).thenReturn(accessTokenDO); + + // 调用,并断言 + assertPojoEquals(accessTokenDO, oauth2GrantService.grantPassword( + username, password, clientId, scopes)); + } + + @Test + public void testGrantRefreshToken() { + // 准备参数 + String refreshToken = randomString(); + String clientId = randomString(); + // mock 方法 + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.refreshAccessToken(eq(refreshToken), eq(clientId))) + .thenReturn(accessTokenDO); + + // 调用,并断言 + assertPojoEquals(accessTokenDO, oauth2GrantService.grantRefreshToken( + refreshToken, clientId)); + } + + @Test + public void testRevokeToken_clientIdError() { + // 准备参数 + String clientId = randomString(); + String accessToken = randomString(); + // mock 方法 + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.getAccessToken(eq(accessToken))).thenReturn(accessTokenDO); + + // 调用,并断言 + assertFalse(oauth2GrantService.revokeToken(clientId, accessToken)); + } + + @Test + public void testRevokeToken_success() { + // 准备参数 + String clientId = randomString(); + String accessToken = randomString(); + // mock 方法(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class).setClientId(clientId); + when(oauth2TokenService.getAccessToken(eq(accessToken))).thenReturn(accessTokenDO); + // mock 方法(移除) + when(oauth2TokenService.removeAccessToken(eq(accessToken))).thenReturn(accessTokenDO); + + // 调用,并断言 + assertTrue(oauth2GrantService.revokeToken(clientId, accessToken)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImplTest.java new file mode 100644 index 000000000..7cf5aa272 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImplTest.java @@ -0,0 +1,290 @@ +package cn.iocoder.yudao.module.system.service.oauth2; + +import cn.hutool.core.util.RandomUtil; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbAndRedisUnitTest; +import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.token.OAuth2AccessTokenPageReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; +import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2RefreshTokenDO; +import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2AccessTokenMapper; +import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2RefreshTokenMapper; +import cn.iocoder.yudao.module.system.dal.redis.oauth2.OAuth2AccessTokenRedisDAO; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.time.Duration; +import java.util.Date; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +/** + * {@link OAuth2TokenServiceImpl} 的单元测试类 + * + * @author 芋道源码 + */ +@Import({OAuth2TokenServiceImpl.class, OAuth2AccessTokenRedisDAO.class}) +public class OAuth2TokenServiceImplTest extends BaseDbAndRedisUnitTest { + + @Resource + private OAuth2TokenServiceImpl oauth2TokenService; + + @Resource + private OAuth2AccessTokenMapper oauth2AccessTokenMapper; + @Resource + private OAuth2RefreshTokenMapper oauth2RefreshTokenMapper; + + @Resource + private OAuth2AccessTokenRedisDAO oauth2AccessTokenRedisDAO; + + @MockBean + private OAuth2ClientService oauth2ClientService; + + @Test + public void testCreateAccessToken() { + TenantContextHolder.setTenantId(0L); + // 准备参数 + Long userId = randomLongId(); + Integer userType = RandomUtil.randomEle(UserTypeEnum.values()).getValue(); + String clientId = randomString(); + List scopes = Lists.newArrayList("read", "write"); + // mock 方法 + OAuth2ClientDO clientDO = randomPojo(OAuth2ClientDO.class).setClientId(clientId) + .setAccessTokenValiditySeconds(30).setRefreshTokenValiditySeconds(60); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))).thenReturn(clientDO); + + // 调用 + OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(userId, userType, clientId, scopes); + // 断言访问令牌 + OAuth2AccessTokenDO dbAccessTokenDO = oauth2AccessTokenMapper.selectByAccessToken(accessTokenDO.getAccessToken()); + assertPojoEquals(accessTokenDO, dbAccessTokenDO, "createTime", "updateTime", "deleted"); + assertEquals(userId, accessTokenDO.getUserId()); + assertEquals(userType, accessTokenDO.getUserType()); + assertEquals(clientId, accessTokenDO.getClientId()); + assertEquals(scopes, accessTokenDO.getScopes()); + assertFalse(DateUtils.isExpired(accessTokenDO.getExpiresTime())); + // 断言访问令牌的缓存 + OAuth2AccessTokenDO redisAccessTokenDO = oauth2AccessTokenRedisDAO.get(accessTokenDO.getAccessToken()); + assertPojoEquals(accessTokenDO, redisAccessTokenDO, "createTime", "updateTime", "deleted"); + // 断言刷新令牌 + OAuth2RefreshTokenDO refreshTokenDO = oauth2RefreshTokenMapper.selectList().get(0); + assertPojoEquals(accessTokenDO, refreshTokenDO, "id", "expiresTime", "createTime", "updateTime", "deleted"); + assertFalse(DateUtils.isExpired(refreshTokenDO.getExpiresTime())); + } + + @Test + public void testRefreshAccessToken_null() { + // 准备参数 + String refreshToken = randomString(); + String clientId = randomString(); + // mock 方法 + + // 调用,并断言 + assertServiceException(() -> oauth2TokenService.refreshAccessToken(refreshToken, clientId), + new ErrorCode(400, "无效的刷新令牌")); + } + + @Test + public void testRefreshAccessToken_clientIdError() { + // 准备参数 + String refreshToken = randomString(); + String clientId = randomString(); + // mock 方法 + OAuth2ClientDO clientDO = randomPojo(OAuth2ClientDO.class).setClientId(clientId); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))).thenReturn(clientDO); + // mock 数据(访问令牌) + OAuth2RefreshTokenDO refreshTokenDO = randomPojo(OAuth2RefreshTokenDO.class) + .setRefreshToken(refreshToken).setClientId("error"); + oauth2RefreshTokenMapper.insert(refreshTokenDO); + + // 调用,并断言 + assertServiceException(() -> oauth2TokenService.refreshAccessToken(refreshToken, clientId), + new ErrorCode(400, "刷新令牌的客户端编号不正确")); + } + + @Test + public void testRefreshAccessToken_expired() { + // 准备参数 + String refreshToken = randomString(); + String clientId = randomString(); + // mock 方法 + OAuth2ClientDO clientDO = randomPojo(OAuth2ClientDO.class).setClientId(clientId); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))).thenReturn(clientDO); + // mock 数据(访问令牌) + OAuth2RefreshTokenDO refreshTokenDO = randomPojo(OAuth2RefreshTokenDO.class) + .setRefreshToken(refreshToken).setClientId(clientId) + .setExpiresTime(addTime(Duration.ofDays(-1))); + oauth2RefreshTokenMapper.insert(refreshTokenDO); + + // 调用,并断言 + assertServiceException(() -> oauth2TokenService.refreshAccessToken(refreshToken, clientId), + new ErrorCode(401, "刷新令牌已过期")); + assertEquals(0, oauth2RefreshTokenMapper.selectCount()); + } + + @Test + public void testRefreshAccessToken_success() { + TenantContextHolder.setTenantId(0L); + // 准备参数 + String refreshToken = randomString(); + String clientId = randomString(); + // mock 方法 + OAuth2ClientDO clientDO = randomPojo(OAuth2ClientDO.class).setClientId(clientId) + .setAccessTokenValiditySeconds(30); + when(oauth2ClientService.validOAuthClientFromCache(eq(clientId))).thenReturn(clientDO); + // mock 数据(访问令牌) + OAuth2RefreshTokenDO refreshTokenDO = randomPojo(OAuth2RefreshTokenDO.class) + .setRefreshToken(refreshToken).setClientId(clientId) + .setExpiresTime(addTime(Duration.ofDays(1))); + oauth2RefreshTokenMapper.insert(refreshTokenDO); + // mock 数据(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class).setRefreshToken(refreshToken); + oauth2AccessTokenMapper.insert(accessTokenDO); + oauth2AccessTokenRedisDAO.set(accessTokenDO); + + // 调用 + OAuth2AccessTokenDO newAccessTokenDO = oauth2TokenService.refreshAccessToken(refreshToken, clientId); + // 断言,老的访问令牌被删除 + assertNull(oauth2AccessTokenMapper.selectByAccessToken(accessTokenDO.getAccessToken())); + assertNull(oauth2AccessTokenRedisDAO.get(accessTokenDO.getAccessToken())); + // 断言,新的访问令牌 + OAuth2AccessTokenDO dbAccessTokenDO = oauth2AccessTokenMapper.selectByAccessToken(newAccessTokenDO.getAccessToken()); + assertPojoEquals(newAccessTokenDO, dbAccessTokenDO, "createTime", "updateTime", "deleted"); + assertPojoEquals(newAccessTokenDO, refreshTokenDO, "id", "expiresTime", "createTime", "updateTime", "deleted", + "creator", "updater"); + assertFalse(DateUtils.isExpired(newAccessTokenDO.getExpiresTime())); + // 断言,新的访问令牌的缓存 + OAuth2AccessTokenDO redisAccessTokenDO = oauth2AccessTokenRedisDAO.get(newAccessTokenDO.getAccessToken()); + assertPojoEquals(newAccessTokenDO, redisAccessTokenDO, "createTime", "updateTime", "deleted"); + } + + @Test + public void testGetAccessToken() { + // mock 数据(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofDays(1))); + oauth2AccessTokenMapper.insert(accessTokenDO); + // 准备参数 + String accessToken = accessTokenDO.getAccessToken(); + + // 调用 + OAuth2AccessTokenDO result = oauth2TokenService.getAccessToken(accessToken); + // 断言 + assertPojoEquals(accessTokenDO, result, "createTime", "updateTime", "deleted", + "creator", "updater"); + assertPojoEquals(accessTokenDO, oauth2AccessTokenRedisDAO.get(accessToken), "createTime", "updateTime", "deleted", + "creator", "updater"); + } + + @Test + public void testCheckAccessToken_null() { + // 调研,并断言 + assertServiceException(() -> oauth2TokenService.checkAccessToken(randomString()), + new ErrorCode(401, "访问令牌不存在")); + } + + @Test + public void testCheckAccessToken_expired() { + // mock 数据(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofDays(-1))); + oauth2AccessTokenMapper.insert(accessTokenDO); + // 准备参数 + String accessToken = accessTokenDO.getAccessToken(); + + // 调研,并断言 + assertServiceException(() -> oauth2TokenService.checkAccessToken(accessToken), + new ErrorCode(401, "访问令牌已过期")); + } + + @Test + public void testCheckAccessToken_success() { + // mock 数据(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofDays(1))); + oauth2AccessTokenMapper.insert(accessTokenDO); + // 准备参数 + String accessToken = accessTokenDO.getAccessToken(); + + // 调研,并断言 + OAuth2AccessTokenDO result = oauth2TokenService.getAccessToken(accessToken); + // 断言 + assertPojoEquals(accessTokenDO, result, "createTime", "updateTime", "deleted", + "creator", "updater"); + } + + @Test + public void testRemoveAccessToken_null() { + // 调用,并断言 + assertNull(oauth2TokenService.removeAccessToken(randomString())); + } + + @Test + public void testRemoveAccessToken_success() { + // mock 数据(访问令牌) + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) + .setExpiresTime(addTime(Duration.ofDays(1))); + oauth2AccessTokenMapper.insert(accessTokenDO); + // mock 数据(刷新令牌) + OAuth2RefreshTokenDO refreshTokenDO = randomPojo(OAuth2RefreshTokenDO.class) + .setRefreshToken(accessTokenDO.getRefreshToken()); + oauth2RefreshTokenMapper.insert(refreshTokenDO); + // 调用 + OAuth2AccessTokenDO result = oauth2TokenService.removeAccessToken(accessTokenDO.getAccessToken()); + assertPojoEquals(accessTokenDO, result, "createTime", "updateTime", "deleted", + "creator", "updater"); + // 断言数据 + assertNull(oauth2AccessTokenMapper.selectByAccessToken(accessTokenDO.getAccessToken())); + assertNull(oauth2RefreshTokenMapper.selectByRefreshToken(accessTokenDO.getRefreshToken())); + assertNull(oauth2AccessTokenRedisDAO.get(accessTokenDO.getAccessToken())); + } + + + @Test + public void testGetAccessTokenPage() { + // mock 数据 + OAuth2AccessTokenDO dbAccessToken = randomPojo(OAuth2AccessTokenDO.class, o -> { // 等会查询到 + o.setUserId(10L); + o.setUserType(1); + o.setClientId("test_client"); + o.setExpiresTime(DateUtils.addTime(Duration.ofDays(1))); + }); + oauth2AccessTokenMapper.insert(dbAccessToken); + // 测试 userId 不匹配 + oauth2AccessTokenMapper.insert(cloneIgnoreId(dbAccessToken, o -> o.setUserId(20L))); + // 测试 userType 不匹配 + oauth2AccessTokenMapper.insert(cloneIgnoreId(dbAccessToken, o -> o.setUserType(2))); + // 测试 userType 不匹配 + oauth2AccessTokenMapper.insert(cloneIgnoreId(dbAccessToken, o -> o.setClientId("it_client"))); + // 测试 expireTime 不匹配 + oauth2AccessTokenMapper.insert(cloneIgnoreId(dbAccessToken, o -> o.setExpiresTime(new Date()))); + // 准备参数 + OAuth2AccessTokenPageReqVO reqVO = new OAuth2AccessTokenPageReqVO(); + reqVO.setUserId(10L); + reqVO.setUserType(1); + reqVO.setClientId("test"); + + // 调用 + PageResult pageResult = oauth2TokenService.getAccessTokenPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbAccessToken, pageResult.getList().get(0)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java index 74ef697e3..b81777fb6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java @@ -3,15 +3,17 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.enums.permission.DataScopeEnum; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper; +import cn.iocoder.yudao.module.system.enums.permission.DataScopeEnum; import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; import cn.iocoder.yudao.module.system.mq.producer.permission.RoleProducer; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; @@ -20,6 +22,7 @@ import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; @@ -155,61 +158,66 @@ public class RoleServiceTest extends BaseDbUnitTest { } @Test - public void testGetRoles_success() { - Map idRoleMap = new HashMap<>(); - // 验证查询状态为1的角色 - RoleDO roleDO1 = createRoleDO("role1", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 1); - roleMapper.insert(roleDO1); - idRoleMap.put(roleDO1.getId(), roleDO1); - - RoleDO roleDO2 = createRoleDO("role2", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 1); - roleMapper.insert(roleDO2); - idRoleMap.put(roleDO2.getId(), roleDO2); - - // 以下是排除的角色 - RoleDO roleDO3 = createRoleDO("role3", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 2); - roleMapper.insert(roleDO3); - - //调用 - List roles = roleService.getRoles(Arrays.asList(1)); - - //断言 - assertEquals(2, roles.size()); - roles.stream().forEach(r -> assertPojoEquals(idRoleMap.get(r.getId()), r)); + public void testGetRoles() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 + o.setName("土豆"); + o.setCode("tudou"); + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setCreateTime(DateUtils.buildTime(2022, 2, 8)); + }); + roleMapper.insert(dbRole); + // 测试 name 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); + // 测试 code 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); + // 测试 createTime 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(DateUtils.buildTime(2022, 2, 16)))); + // 准备参数 + RoleExportReqVO reqVO = new RoleExportReqVO(); + reqVO.setName("土豆"); + reqVO.setCode("tu"); + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); + reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); + // 调用 + List list = roleService.getRoleList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbRole, list.get(0)); } @Test - public void testGetRolePage_success() { - Map idRoleMap = new HashMap<>(); - // 验证名称包含"role", 状态为1,code为"code"的角色 - // 第一页 - RoleDO roleDO = createRoleDO("role1", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 1, "code"); - roleMapper.insert(roleDO); - idRoleMap.put(roleDO.getId(), roleDO); - // 第二页 - roleDO = createRoleDO("role2", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 1, "code"); - roleMapper.insert(roleDO); - - // 以下是排除的角色 - roleDO = createRoleDO("role3", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 2, "code"); - roleMapper.insert(roleDO); - roleDO = createRoleDO("role4", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, 1, "xxxxx"); - roleMapper.insert(roleDO); - - //调用 - RolePageReqVO reqVO = randomPojo(RolePageReqVO.class, o -> { - o.setName("role"); - o.setCode("code"); - o.setStatus(1); - o.setPageNo(1); - o.setPageSize(1); - o.setBeginTime(null); - o.setEndTime(null); + public void testGetRolePage() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 + o.setName("土豆"); + o.setCode("tudou"); + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setCreateTime(DateUtils.buildTime(2022, 2, 8)); }); - PageResult result = roleService.getRolePage(reqVO); - assertEquals(2, result.getTotal()); - result.getList().stream().forEach(r -> assertPojoEquals(idRoleMap.get(r.getId()), r)); + roleMapper.insert(dbRole); + // 测试 name 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); + // 测试 code 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); + // 测试 createTime 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(DateUtils.buildTime(2022, 2, 16)))); + // 准备参数 + RolePageReqVO reqVO = new RolePageReqVO(); + reqVO.setName("土豆"); + reqVO.setCode("tu"); + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); + reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); + + // 调用 + PageResult pageResult = roleService.getRolePage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbRole, pageResult.getList().get(0)); } @Test diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java index 37ff97fda..61daa866f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.module.system.service.tenant; -import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.tenant.config.TenantProperties; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO; @@ -16,14 +16,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO; import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; -import cn.iocoder.yudao.module.system.mq.producer.tenant.TenantProducer; import cn.iocoder.yudao.module.system.service.permission.MenuService; import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.tenant.handler.TenantInfoHandler; import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; @@ -34,13 +32,11 @@ import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Map; import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; @@ -78,43 +74,18 @@ public class TenantServiceImplTest extends BaseDbUnitTest { private MenuService menuService; @MockBean private PermissionService permissionService; - @MockBean - private TenantProducer tenantProducer; @BeforeEach public void setUp() { - // 清理缓存 - ReflectUtil.setFieldValue(tenantService, "tenantCache", Collections.emptyMap()); - ReflectUtil.setFieldValue(tenantService, "maxUpdateTime", null); // 清理租户上下文 TenantContextHolder.clear(); } - @Test - public void testInitLocalCache() { - // mock 数据 - TenantDO tenantDO1 = randomPojo(TenantDO.class); - tenantMapper.insert(tenantDO1); - TenantDO tenantDO2 = randomPojo(TenantDO.class); - tenantMapper.insert(tenantDO2); - - // 调用 - tenantService.initLocalCache(); - // 断言 tenantCache 缓存 - Map tenantCache = tenantService.getTenantCache(); - assertEquals(2, tenantCache.size()); - assertPojoEquals(tenantDO1, tenantCache.get(tenantDO1.getId())); - assertPojoEquals(tenantDO2, tenantCache.get(tenantDO2.getId())); - // 断言 maxUpdateTime 缓存 - assertEquals(max(tenantDO1.getUpdateTime(), tenantDO2.getUpdateTime()), tenantService.getMaxUpdateTime()); - } - @Test public void testGetTenantIds() { // mock 数据 TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L)); tenantMapper.insert(tenant); - tenantService.initLocalCache(); // 调用,并断言业务异常 List result = tenantService.getTenantIds(); @@ -131,7 +102,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { // mock 数据 TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L).setStatus(CommonStatusEnum.DISABLE.getStatus())); tenantMapper.insert(tenant); - tenantService.initLocalCache(); // 调用,并断言业务异常 assertServiceException(() -> tenantService.validTenant(1L), TENANT_DISABLE, tenant.getName()); @@ -143,7 +113,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L).setStatus(CommonStatusEnum.ENABLE.getStatus()) .setExpireTime(buildTime(2020, 2, 2))); tenantMapper.insert(tenant); - tenantService.initLocalCache(); // 调用,并断言业务异常 assertServiceException(() -> tenantService.validTenant(1L), TENANT_EXPIRE, tenant.getName()); @@ -155,7 +124,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L).setStatus(CommonStatusEnum.ENABLE.getStatus()) .setExpireTime(addTime(Duration.ofDays(1)))); tenantMapper.insert(tenant); - tenantService.initLocalCache(); // 调用,并断言业务异常 tenantService.validTenant(1L); @@ -206,8 +174,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { verify(permissionService).assignRoleMenu(eq(200L), same(tenantPackage.getMenuIds())); // verify 分配角色 verify(permissionService).assignUserRole(eq(300L), eq(singleton(200L))); - // verify 发送刷新消息 - verify(tenantProducer).sendTenantRefreshMessage(); } @Test @@ -240,8 +206,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { // 校验是否更新正确 TenantDO tenant = tenantMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, tenant); - // verify 发送刷新消息 - verify(tenantProducer).sendTenantRefreshMessage(); // verify 设置角色权限 verify(permissionService).assignRoleMenu(eq(100L), eq(asSet(200L, 201L))); verify(permissionService).assignRoleMenu(eq(101L), eq(asSet(201L))); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java index 4bacb2657..39f4c0152 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java @@ -225,7 +225,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { ByteArrayInputStream avatarFile = new ByteArrayInputStream(avatarFileBytes); // mock 方法 String avatar = randomString(); - when(fileApi.createFile(eq(avatarFileBytes))).thenReturn(avatar); + when(fileApi.createFile(eq( avatarFileBytes))).thenReturn(avatar); // 调用 userService.updateUserAvatar(userId, avatarFile); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql index 8eec9fefc..b13b191db 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql @@ -21,3 +21,7 @@ DELETE FROM "system_tenant"; DELETE FROM "system_tenant_package"; DELETE FROM "system_sensitive_word"; DELETE FROM "system_oauth2_client"; +DELETE FROM "system_oauth2_approve"; +DELETE FROM "system_oauth2_access_token"; +DELETE FROM "system_oauth2_refresh_token"; +DELETE FROM "system_oauth2_code"; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql index 3cc860101..56fc42704 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql @@ -482,9 +482,9 @@ CREATE TABLE IF NOT EXISTS "system_oauth2_client" ( "access_token_validity_seconds" int NOT NULL, "refresh_token_validity_seconds" int NOT NULL, "redirect_uris" varchar NOT NULL, - "auto_approve" bit NOT NULL DEFAULT FALSE, "authorized_grant_types" varchar NOT NULL, "scopes" varchar NOT NULL DEFAULT '', + "auto_approve_scopes" varchar NOT NULL DEFAULT '', "authorities" varchar NOT NULL DEFAULT '', "resource_ids" varchar NOT NULL DEFAULT '', "additional_information" varchar NOT NULL DEFAULT '', @@ -495,3 +495,73 @@ CREATE TABLE IF NOT EXISTS "system_oauth2_client" ( "deleted" bit NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT 'OAuth2 客户端表'; + +CREATE TABLE IF NOT EXISTS "system_oauth2_approve" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" tinyint NOT NULL, + "client_id" varchar NOT NULL, + "scope" varchar NOT NULL, + "approved" bit NOT NULL DEFAULT FALSE, + "expires_time" datetime NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT 'OAuth2 批准表'; + +CREATE TABLE IF NOT EXISTS "system_oauth2_access_token" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" tinyint NOT NULL, + "access_token" varchar NOT NULL, + "refresh_token" varchar NOT NULL, + "client_id" varchar NOT NULL, + "scopes" varchar NOT NULL, + "approved" bit NOT NULL DEFAULT FALSE, + "expires_time" datetime NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint NOT NULL, + PRIMARY KEY ("id") +) COMMENT 'OAuth2 访问令牌'; + +CREATE TABLE IF NOT EXISTS "system_oauth2_refresh_token" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" tinyint NOT NULL, + "refresh_token" varchar NOT NULL, + "client_id" varchar NOT NULL, + "scopes" varchar NOT NULL, + "approved" bit NOT NULL DEFAULT FALSE, + "expires_time" datetime NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT 'OAuth2 刷新令牌'; + +CREATE TABLE IF NOT EXISTS "system_oauth2_code" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" tinyint NOT NULL, + "code" varchar NOT NULL, + "client_id" varchar NOT NULL, + "scopes" varchar NOT NULL, + "expires_time" datetime NOT NULL, + "redirect_uri" varchar NOT NULL, + "state" varchar NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT 'OAuth2 刷新令牌'; diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index d196f5797..31c863fc6 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -41,17 +41,31 @@ yudao-module-pay-biz ${revision} + + cn.iocoder.boot + yudao-module-market-biz + ${revision} + + + cn.iocoder.boot + yudao-module-product-biz + ${revision} + cn.iocoder.boot yudao-module-bpm-biz ${revision} - - - - + + + + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-error-code + @@ -59,6 +73,10 @@ spring-boot-configuration-processor true + + cn.iocoder.boot + yudao-spring-boot-starter-banner + @@ -76,7 +94,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.5.12 + 2.6.7 true diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java deleted file mode 100644 index 3006aa4ae..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 目的:项目启动成功后,提供文档相关的地址 - */ -package cn.iocoder.yudao.server.framework.tip; diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml index 4989a6146..e54bec4fc 100644 --- a/yudao-server/src/main/resources/application-dev.yaml +++ b/yudao-server/src/main/resources/application-dev.yaml @@ -171,10 +171,6 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta # 芋道配置项,设置当前项目所有自定义的配置 yudao: - security: - token-header: Authorization - mock-enable: true - mock-secret: test xss: enable: false exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index beed068e5..177abf9e4 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -173,10 +173,9 @@ logging: cn.iocoder.yudao.module.tool.dal.mysql: debug cn.iocoder.yudao.module.member.dal.mysql: debug ---- #################### 微信公众号相关配置 #################### -wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 - mp: - # 公众号配置(必填) +--- #################### 微信公众号、小程序相关配置 #################### +wx: + mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 app-id: wx041349c6f39b268b secret: 5abee519483bc9f8cb37ce280e814bd0 # 存储配置,解决 AccessToken 的跨节点的共享 @@ -184,6 +183,13 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 key-prefix: wx # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置 http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 + miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 + appid: wx63c280fe3248a3e7 + secret: 6f270509224a7ae1296bbf1c8cb97aed + config-storage: + type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 + key-prefix: wa # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置 + http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 --- #################### 芋道相关配置 #################### @@ -192,9 +198,7 @@ yudao: captcha: enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试 security: - token-header: Authorization mock-enable: true - mock-secret: test xss: enable: false exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 @@ -204,6 +208,10 @@ yudao: pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify pay-return-url: http://niubi.natapp1.cc/api/pay/order/return refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify + access-log: # 访问日志的配置项 + enable: false + error-code: # 错误码相关配置项 + enable: false demo: false # 关闭演示模式 justauth: @@ -218,6 +226,12 @@ justauth: client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw agent-id: 1000004 ignore-check-redirect-uri: true + WECHAT_MINI_APP: # 微信小程序 + client-id: ${wx.miniapp.appid} + client-secret: ${wx.miniapp.secret} + ignore-check-redirect-uri: true + ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验 + cache: type: REDIS prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 534598cd4..18b02a002 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -5,12 +5,18 @@ spring: profiles: active: local + main: + allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 + # Servlet 配置 servlet: # 文件上传相关配置项 multipart: max-file-size: 16MB # 单个文件大小 max-request-size: 32MB # 设置总上传的文件大小 + mvc: + pathmatch: + matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类 # Jackson 配置项 jackson: @@ -58,14 +64,11 @@ yudao: version: 1.0.0 base-package: cn.iocoder.yudao web: - admin-api: - prefix: /admin-api - controller: '**.controller.admin.**' - app-api: - prefix: /app-api - controller: '**.controller.app.**' admin-ui: url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址 + security: + permit-all_urls: + - /admin-ui/** # /resources/admin-ui 目录下的静态资源 swagger: title: 管理后台 description: 提供管理员管理的所有功能 @@ -92,6 +95,7 @@ yudao: - /admin-api/system/captcha/get-image # 获取图片验证码,和租户无关 - /admin-api/infra/file/*/get/** # 获取图片,和租户无关 - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号 + - /app-api/pay/order/notify/* # 支付回调通知,不携带租户编号 ignore-tables: - system_tenant - system_tenant_package diff --git a/yudao-server/src/main/resources/logback-spring.xml b/yudao-server/src/main/resources/logback-spring.xml index 8c85ad493..9de3a68b1 100644 --- a/yudao-server/src/main/resources/logback-spring.xml +++ b/yudao-server/src/main/resources/logback-spring.xml @@ -4,7 +4,7 @@ - +       diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index 2cb2f9640..e3b8c11c8 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -48,8 +48,12 @@ public class ProjectReactor { String packageNameNew = "cn.start.pp"; String titleNew = "土豆管理系统"; String projectBaseDirNew = projectBaseDir + "-new"; // 一键改名后,“新”项目所在的目录 - log.info("[main][新项目路径地址 ({})]", projectBaseDirNew); - + log.info("[main][检测新项目目录 ({})是否存在]", projectBaseDirNew); + if (FileUtil.exist(projectBaseDirNew)) { + log.info("[main][新项目目录检测 ({})已存在,请更改新的目录,程序退出]", projectBaseDirNew); + return; + } + log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew); // 获得需要复制的文件 log.info("[main][开始获得需要重写的文件,预计需要 10-20 秒]"); Collection files = listFiles(projectBaseDir); diff --git a/yudao-ui-admin/package.json b/yudao-ui-admin/package.json index 5925a5c0e..11ffd16e2 100644 --- a/yudao-ui-admin/package.json +++ b/yudao-ui-admin/package.json @@ -45,7 +45,7 @@ "clipboard": "2.0.8", "core-js": "^3.21.1", "echarts": "4.9.0", - "element-ui": "^2.15.6", + "element-ui": "2.15.8", "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", diff --git a/yudao-ui-admin/src/api/login.js b/yudao-ui-admin/src/api/login.js index a76decf17..390f66900 100644 --- a/yudao-ui-admin/src/api/login.js +++ b/yudao-ui-admin/src/api/login.js @@ -3,12 +3,15 @@ import {getRefreshToken} from "@/utils/auth"; import service from "@/utils/request"; // 登录方法 -export function login(username, password, code, uuid) { +export function login(username, password, code, uuid, + socialType, socialCode, socialState) { const data = { username, password, code, - uuid + uuid, + // 社交相关 + socialType, socialCode, socialState } return request({ url: '/system/auth/login', @@ -51,9 +54,9 @@ export function socialAuthRedirect(type, redirectUri) { } // 社交快捷登录,使用 code 授权码 -export function socialQuickLogin(type, code, state) { +export function socialLogin(type, code, state) { return request({ - url: '/system/auth/social-quick-login', + url: '/system/auth/social-login', method: 'post', data: { type, @@ -63,21 +66,6 @@ export function socialQuickLogin(type, code, state) { }) } -// 社交绑定登录,使用 code 授权码 + + 账号密码 -export function socialBindLogin(type, code, state, username, password) { - return request({ - url: '/system/auth/social-bind-login', - method: 'post', - data: { - type, - code, - state, - username, - password - } - }) -} - // 获取登录验证码 export function sendSmsCode(mobile, scene) { return request({ diff --git a/yudao-ui-admin/src/api/mall/market/banner.js b/yudao-ui-admin/src/api/mall/market/banner.js new file mode 100644 index 000000000..57c55def9 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/market/banner.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建Banner +export function createBanner(data) { + return request({ + url: '/market/banner/create', + method: 'post', + data: data + }) +} + +// 更新Banner +export function updateBanner(data) { + return request({ + url: '/market/banner/update', + method: 'put', + data: data + }) +} + +// 删除Banner +export function deleteBanner(id) { + return request({ + url: '/market/banner/delete?id=' + id, + method: 'delete' + }) +} + +// 获得Banner +export function getBanner(id) { + return request({ + url: '/market/banner/get?id=' + id, + method: 'get' + }) +} + +// 获得Banner分页 +export function getBannerPage(query) { + return request({ + url: '/market/banner/page', + method: 'get', + params: query + }) +} + +// 导出Banner Excel +export function exportBannerExcel(query) { + return request({ + url: '/market/banner/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/api/mall/product/brand.js b/yudao-ui-admin/src/api/mall/product/brand.js new file mode 100644 index 000000000..69cb61c08 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/brand.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建品牌 +export function createBrand(data) { + return request({ + url: '/product/brand/create', + method: 'post', + data: data + }) +} + +// 更新品牌 +export function updateBrand(data) { + return request({ + url: '/product/brand/update', + method: 'put', + data: data + }) +} + +// 删除品牌 +export function deleteBrand(id) { + return request({ + url: '/product/brand/delete?id=' + id, + method: 'delete' + }) +} + +// 获得品牌 +export function getBrand(id) { + return request({ + url: '/product/brand/get?id=' + id, + method: 'get' + }) +} + +// 获得品牌分页 +export function getBrandPage(query) { + return request({ + url: '/product/brand/page', + method: 'get', + params: query + }) +} + +// 导出品牌 Excel +export function exportBrandExcel(query) { + return request({ + url: '/product/brand/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/api/mall/product/category.js b/yudao-ui-admin/src/api/mall/product/category.js new file mode 100644 index 000000000..bd825034d --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/category.js @@ -0,0 +1,63 @@ +import request from '@/utils/request' + +// 创建商品分类 +export function createCategory(data) { + return request({ + url: '/product/category/create', + method: 'post', + data: data + }) +} + +// 更新商品分类 +export function updateCategory(data) { + return request({ + url: '/product/category/update', + method: 'put', + data: data + }) +} + +// 删除商品分类 +export function deleteCategory(id) { + return request({ + url: '/product/category/delete?id=' + id, + method: 'delete' + }) +} + +// 获得商品分类 +export function getCategory(id) { + return request({ + url: '/product/category/get?id=' + id, + method: 'get' + }) +} + +// 获得商品分类 +export function listCategory(query) { + return request({ + url: '/product/category/listByQuery', + method: 'get', + params: query + }) +} + +// 获得商品分类分页 +export function getCategoryPage(query) { + return request({ + url: '/product/category/page', + method: 'get', + params: query + }) +} + +// 导出商品分类 Excel +export function exportCategoryExcel(query) { + return request({ + url: '/product/category/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/api/mall/product/property.js b/yudao-ui-admin/src/api/mall/product/property.js new file mode 100644 index 000000000..58ae320f6 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/property.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建规格名称 +export function createProperty(data) { + return request({ + url: '/product/property/create', + method: 'post', + data: data + }) +} + +// 更新规格名称 +export function updateProperty(data) { + return request({ + url: '/product/property/update', + method: 'put', + data: data + }) +} + +// 删除规格名称 +export function deleteProperty(id) { + return request({ + url: '/product/property/delete?id=' + id, + method: 'delete' + }) +} + +// 获得规格名称 +export function getProperty(id) { + return request({ + url: '/product/property/get?id=' + id, + method: 'get' + }) +} + +// 获得规格名称分页 +export function getPropertyPage(query) { + return request({ + url: '/product/property/page', + method: 'get', + params: query + }) +} + +// 导出规格名称 Excel +export function exportPropertyExcel(query) { + return request({ + url: '/product/property/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/api/mall/product/spu.js b/yudao-ui-admin/src/api/mall/product/spu.js new file mode 100644 index 000000000..068e7d838 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/spu.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建商品spu +export function createSpu(data) { + return request({ + url: '/product/spu/create', + method: 'post', + data: data + }) +} + +// 更新商品spu +export function updateSpu(data) { + return request({ + url: '/product/spu/update', + method: 'put', + data: data + }) +} + +// 删除商品spu +export function deleteSpu(id) { + return request({ + url: '/product/spu/delete?id=' + id, + method: 'delete' + }) +} + +// 获得商品spu +export function getSpu(id) { + return request({ + url: '/product/spu/get?id=' + id, + method: 'get' + }) +} + +// 获得商品spu分页 +export function getSpuPage(query) { + return request({ + url: '/product/spu/page', + method: 'get', + params: query + }) +} + +// 导出商品spu Excel +export function exportSpuExcel(query) { + return request({ + url: '/product/spu/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/assets/icons/svg/config.svg b/yudao-ui-admin/src/assets/icons/svg/config.svg index 79db5fb6a..4982b1e90 100644 --- a/yudao-ui-admin/src/assets/icons/svg/config.svg +++ b/yudao-ui-admin/src/assets/icons/svg/config.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/download.svg b/yudao-ui-admin/src/assets/icons/svg/download.svg index c89695134..87a04f928 100644 --- a/yudao-ui-admin/src/assets/icons/svg/download.svg +++ b/yudao-ui-admin/src/assets/icons/svg/download.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/merchant.svg b/yudao-ui-admin/src/assets/icons/svg/merchant.svg index f1ecb8127..57be1bc27 100644 --- a/yudao-ui-admin/src/assets/icons/svg/merchant.svg +++ b/yudao-ui-admin/src/assets/icons/svg/merchant.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/monitor.svg b/yudao-ui-admin/src/assets/icons/svg/monitor.svg index bc308cb0f..1cfde117f 100644 --- a/yudao-ui-admin/src/assets/icons/svg/monitor.svg +++ b/yudao-ui-admin/src/assets/icons/svg/monitor.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/order.svg b/yudao-ui-admin/src/assets/icons/svg/order.svg index 676ce3c59..41b37a396 100644 --- a/yudao-ui-admin/src/assets/icons/svg/order.svg +++ b/yudao-ui-admin/src/assets/icons/svg/order.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/pay.svg b/yudao-ui-admin/src/assets/icons/svg/pay.svg index ddab05def..31fe84172 100644 --- a/yudao-ui-admin/src/assets/icons/svg/pay.svg +++ b/yudao-ui-admin/src/assets/icons/svg/pay.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/percentSign.svg b/yudao-ui-admin/src/assets/icons/svg/percentSign.svg index bedbce63d..210947e57 100644 --- a/yudao-ui-admin/src/assets/icons/svg/percentSign.svg +++ b/yudao-ui-admin/src/assets/icons/svg/percentSign.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/icons/svg/system.svg b/yudao-ui-admin/src/assets/icons/svg/system.svg index dba28cf6f..8ab97815c 100644 --- a/yudao-ui-admin/src/assets/icons/svg/system.svg +++ b/yudao-ui-admin/src/assets/icons/svg/system.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yudao-ui-admin/src/assets/styles/element-variables.scss b/yudao-ui-admin/src/assets/styles/element-variables.scss index 8b7a48e9e..9503245d7 100644 --- a/yudao-ui-admin/src/assets/styles/element-variables.scss +++ b/yudao-ui-admin/src/assets/styles/element-variables.scss @@ -17,7 +17,7 @@ $--button-font-weight: 400; $--border-color-light: #dfe4ed; $--border-color-lighter: #e6ebf5; -$--table-border:1px solid#dfe6ec; +$--table-border: 1px solid#dfe6ec; /* icon font path, required */ $--font-path: '~element-ui/lib/theme-chalk/fonts'; diff --git a/yudao-ui-admin/src/components/ImageUpload/index.vue b/yudao-ui-admin/src/components/ImageUpload/index.vue index 1e95d5da7..3f2bda7cc 100644 --- a/yudao-ui-admin/src/components/ImageUpload/index.vue +++ b/yudao-ui-admin/src/components/ImageUpload/index.vue @@ -1,21 +1,21 @@