Compare commits
11 Commits
b8a213849c
...
09b607f240
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09b607f240 | ||
|
|
6ce38602f7 | ||
|
|
34d74b378e | ||
|
|
53d3146ad9 | ||
|
|
a61ecaa019 | ||
|
|
f969670fd3 | ||
|
|
92eda45afd | ||
|
|
2d4251eda7 | ||
|
|
06586b85f6 | ||
|
|
7dc6b24e66 | ||
|
|
4052c5c4d0 |
535
README.md
535
README.md
@@ -1,400 +1,143 @@
|
|||||||
<p align="center">
|
# YuDao Asset Cloud - 资产管理系统
|
||||||
<img src="https://img.shields.io/badge/Spring%20Cloud-2024-blue.svg" alt="Coverage Status">
|
|
||||||
<img src="https://img.shields.io/badge/Spring%20Boot-3.4.5-blue.svg" alt="Downloads">
|
基于 YuDao Cloud 重构的资产管理系统。
|
||||||
<img src="https://img.shields.io/badge/Vue-3.2-blue.svg" alt="Downloads">
|
|
||||||
<img src="https://img.shields.io/github/license/YunaiV/yudao-cloud" alt="Downloads" />
|
## 技术栈
|
||||||
</p>
|
|
||||||
|
- **后端**: Spring Boot 3.5 + Spring Cloud 2024 + JDK 17
|
||||||
|
- **数据库**: MySQL 8.0 + Redis 7.0
|
||||||
|
- **注册中心**: Nacos 2.3
|
||||||
|
- **工作流**: Flowable
|
||||||
|
- **定时任务**: XXL-Job 2.4
|
||||||
|
- **前端**: Vue3 + Vben Admin
|
||||||
|
|
||||||
|
## 项目结构
|
||||||
|
|
||||||
|
```
|
||||||
|
yudao-asset-cloud/
|
||||||
|
├── yudao-dependencies/ # 依赖管理
|
||||||
|
├── yudao-framework/ # 框架核心
|
||||||
|
├── yudao-gateway/ # 网关
|
||||||
|
├── yudao-server/ # 单体启动(开发用)
|
||||||
|
├── yudao-module-system/ # 系统管理模块
|
||||||
|
├── yudao-module-infra/ # 基础设施模块
|
||||||
|
├── yudao-module-bpm/ # 工作流模块
|
||||||
|
├── yudao-module-asset/ # 资产管理模块 ⭐
|
||||||
|
│ ├── yudao-module-asset-api/ # API 接口
|
||||||
|
│ └── yudao-module-asset-biz/ # 业务实现
|
||||||
|
├── sql/ # 数据库脚本
|
||||||
|
└── docker-compose.yml # Docker 编排
|
||||||
|
```
|
||||||
|
|
||||||
|
## 核心功能
|
||||||
|
|
||||||
|
### 第一阶段(已规划)
|
||||||
|
1. **基础数据**: 车辆、客户、停车场
|
||||||
|
2. **备车管理**: 车辆整备、检查项配置
|
||||||
|
3. **合同管理**: 合同创建、审批流
|
||||||
|
4. **交车管理**: 任务派发、交车作业
|
||||||
|
5. **还车管理**: 还车作业、费用结算
|
||||||
|
6. **替换车管理**: 临时/永久替换
|
||||||
|
|
||||||
|
## 快速开始
|
||||||
|
|
||||||
|
### 1. 启动基础环境
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 启动 MySQL + Redis + Nacos + XXL-Job
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
# 查看服务状态
|
||||||
|
docker-compose ps
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 初始化数据库
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 导入 YuDao 基础表
|
||||||
|
mysql -h127.0.0.1 -uroot -p123456 ruoyi-vue-pro < sql/mysql/ruoyi-vue-pro.sql
|
||||||
|
|
||||||
|
# 导入资产管理表
|
||||||
|
mysql -h127.0.0.1 -uroot -p123456 ruoyi-vue-pro < sql/asset-schema.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 启动后端服务
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 方式一:IDEA 启动(推荐开发)
|
||||||
|
# 运行 AssetServerApplication.java
|
||||||
|
|
||||||
|
# 方式二:Maven 启动
|
||||||
|
cd yudao-module-asset/yudao-module-asset-biz
|
||||||
|
mvn spring-boot:run
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 访问地址
|
||||||
|
|
||||||
|
- **Nacos 控制台**: http://localhost:8848/nacos (nacos/nacos)
|
||||||
|
- **XXL-Job 控制台**: http://localhost:9090/xxl-job-admin (admin/123456)
|
||||||
|
- **后端 API**: http://localhost:48083
|
||||||
|
- **测试接口**: http://localhost:48083/admin-api/asset/truck/test
|
||||||
|
|
||||||
|
## 开发规范
|
||||||
|
|
||||||
|
### 数据库表命名
|
||||||
|
- 统一前缀: `asset_`
|
||||||
|
- 示例: `asset_truck`, `asset_contract`
|
||||||
|
|
||||||
|
### 包结构
|
||||||
|
```
|
||||||
|
cn.iocoder.yudao.module.asset/
|
||||||
|
├── controller/admin/ # 管理后台控制器
|
||||||
|
├── controller/app/ # 移动端控制器(可选)
|
||||||
|
├── service/ # 服务层
|
||||||
|
├── dal/
|
||||||
|
│ ├── dataobject/ # DO 实体
|
||||||
|
│ ├── mysql/ # Mapper
|
||||||
|
│ └── redis/ # Redis 操作
|
||||||
|
├── convert/ # 对象转换
|
||||||
|
└── enums/ # 枚举
|
||||||
|
```
|
||||||
|
|
||||||
|
### 代码生成
|
||||||
|
使用 YuDao 代码生成器快速生成 CRUD 代码。
|
||||||
|
|
||||||
|
## 部署
|
||||||
|
|
||||||
|
### 开发环境
|
||||||
|
- **服务器**: 47.103.115.36 (Ubuntu 24.04)
|
||||||
|
- **部署方式**: Docker Compose
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 上传项目到服务器
|
||||||
|
scp -r yudao-asset-cloud root@47.103.115.36:/opt/
|
||||||
|
|
||||||
|
# SSH 登录服务器
|
||||||
|
ssh root@47.103.115.36
|
||||||
|
|
||||||
|
# 启动服务
|
||||||
|
cd /opt/yudao-asset-cloud
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## 项目进度
|
||||||
|
|
||||||
|
- [x] 项目初始化
|
||||||
|
- [x] 模块结构搭建
|
||||||
|
- [x] 数据库设计
|
||||||
|
- [x] Docker 环境配置
|
||||||
|
- [ ] 车辆管理 CRUD
|
||||||
|
- [ ] 备车功能
|
||||||
|
- [ ] 合同管理
|
||||||
|
- [ ] 交车功能
|
||||||
|
- [ ] 还车功能
|
||||||
|
- [ ] 替换车功能
|
||||||
|
|
||||||
**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!!**
|
## 文档
|
||||||
|
|
||||||
**「我喜欢写代码,乐此不疲」**
|
- [YuDao Cloud 官方文档](https://cloud.iocoder.cn)
|
||||||
**「我喜欢做开源,以此为乐」**
|
- [项目需求文档](../memory/2026-03-11-资产管理系统重构.md)
|
||||||
|
|
||||||
我 🐶 在上海艰苦奋斗,早中晚在 top3 大厂认真搬砖,夜里为开源做贡献。
|
## 联系方式
|
||||||
|
|
||||||
如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。
|
- 项目负责人: 亮哥(初如)
|
||||||
|
|
||||||
可参考 [《迁移文档》](https://cloud.iocoder.cn/migrate-module/) ,只需要 5-10 分钟,即可将【完整版】按需迁移到【精简版】
|
|
||||||
|
|
||||||
## 🐶 新手必读
|
|
||||||
|
|
||||||
* 演示地址【Vue3 + element-plus】:<http://dashboard-vue3.yudao.iocoder.cn>
|
|
||||||
* 演示地址【Vue3 + vben(ant-design-vue)】:<http://dashboard-vben.yudao.iocoder.cn>
|
|
||||||
* 演示地址【Vue2 + element-ui】:<http://dashboard.yudao.iocoder.cn>
|
|
||||||
* 启动文档:<https://cloud.iocoder.cn/quick-start/>
|
|
||||||
* 视频教程:<https://cloud.iocoder.cn/video/>
|
|
||||||
|
|
||||||
## 🐰 版本说明
|
|
||||||
|
|
||||||
| 版本 | JDK 8 + Spring Boot 2.7 | JDK 17/21 + Spring Boot 3.2 |
|
|
||||||
|-----------------------------------------------------------------------|--------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
|
|
||||||
| 【完整版】[yudao-cloud](https://gitee.com/zhijiantianya/yudao-cloud) | [`master`](https://gitee.com/zhijiantianya/yudao-cloud/tree/master/) 分支 | [`master-jdk17`](https://gitee.com/zhijiantianya/yudao-cloud/tree/master-jdk17/) 分支 |
|
|
||||||
| 【精简版】[yudao-cloud-mini](https://gitee.com/yudaocode/yudao-cloud-mini) | [`master`](https://gitee.com/yudaocode/yudao-cloud-mini/tree/master/) 分支 | [`master-jdk17`](https://gitee.com/yudaocode/yudao-cloud-mini/tree/master-jdk17/) 分支 |
|
|
||||||
|
|
||||||
* 【完整版】:包括系统功能、基础设施、会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP 等功能
|
|
||||||
* 【精简版】:只包括系统功能、基础设施功能,不包括会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP 等功能
|
|
||||||
|
|
||||||
可参考 [《迁移文档》](https://cloud.iocoder.cn/migrate-module/) ,只需要 5-10 分钟,即可将【完整版】按需迁移到【精简版】
|
|
||||||
|
|
||||||
## 🐯 平台简介
|
|
||||||
|
|
||||||
**芋道**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。
|
|
||||||
|
|
||||||
> 有任何问题,或者想要的功能,可以在 _Issues_ 中提给艿艿。
|
|
||||||
>
|
|
||||||
> 😜 给项目点点 Star 吧,这对我们真的很重要!
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
* Java 后端:`master` 分支为 JDK 8 + Spring Boot 2.7,`master-jdk17` 分支为 JDK 17/21 + Spring Boot 3.2
|
|
||||||
* 管理后台的电脑端:Vue3 提供 [element-plus](https://gitee.com/yudaocode/yudao-ui-admin-vue3)、[vben(ant-design-vue)](https://gitee.com/yudaocode/yudao-ui-admin-vben) 两个版本,Vue2 提供 [element-ui](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin) 版本
|
|
||||||
* 管理后台的移动端:采用 [uni-app](https://github.com/dcloudio/uni-app) 方案,一份代码多终端适配,同时支持 APP、小程序、H5!
|
|
||||||
* 后端采用 Spring Cloud Alibaba 微服务架构,注册中心 + 配置中心 Nacos,定时任务 XXL-Job,服务保障 Sentinel,服务网关 Gateway,分布式事务 Seata
|
|
||||||
* 数据库可使用 MySQL、Oracle、PostgreSQL、SQL Server、MariaDB、国产达梦 DM、TiDB 等,基于 MyBatis Plus、Redis + Redisson 操作
|
|
||||||
* 消息队列可使用 Event、Redis、RabbitMQ、Kafka、RocketMQ 等
|
|
||||||
* 权限认证使用 Spring Security & Token & Redis,支持多终端、多种用户的认证系统,支持 SSO 单点登录
|
|
||||||
* 支持加载动态权限菜单,按钮级别权限控制,Redis 缓存提升性能
|
|
||||||
* 支持 SaaS 多租户,可自定义每个租户的权限,提供透明化的多租户底层封装
|
|
||||||
* 工作流使用 Flowable,支持动态表单、在线设计流程、会签 / 或签、多种任务分配方式
|
|
||||||
* 高效率开发,使用代码生成器可以一键生成 Java、Vue 前后端代码、SQL 脚本、接口文档,支持单表、树表、主子表
|
|
||||||
* 实时通信,采用 Spring WebSocket 实现,内置 Token 身份校验,支持 WebSocket 集群
|
|
||||||
* 集成微信小程序、微信公众号、企业微信、钉钉等三方登陆,集成支付宝、微信等支付与退款
|
|
||||||
* 集成阿里云、腾讯云等短信渠道,集成 MinIO、阿里云、腾讯云、七牛云等云存储服务
|
|
||||||
* 集成报表设计器、大屏设计器,通过拖拽即可生成酷炫的报表与大屏
|
|
||||||
|
|
||||||
## 🐳 项目关系
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
三个项目的功能对比,可见社区共同整理的 [国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn) 表格。
|
|
||||||
|
|
||||||
### 后端项目
|
|
||||||
|
|
||||||
| 项目 | Star | 简介 |
|
|
||||||
|-----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
|
|
||||||
| [ruoyi-vue-pro](https://gitee.com/zhijiantianya/ruoyi-vue-pro) | [](https://gitee.com/zhijiantianya/ruoyi-vue-pro) [](https://github.com/YunaiV/ruoyi-vue-pro) | 基于 Spring Boot 多模块架构 |
|
|
||||||
| [yudao-cloud](https://gitee.com/zhijiantianya/yudao-cloud) | [](https://gitee.com/zhijiantianya/yudao-cloud) [](https://github.com/YunaiV/yudao-cloud) | 基于 Spring Cloud 微服务架构 |
|
|
||||||
| [Spring-Boot-Labs](https://gitee.com/yudaocode/SpringBoot-Labs) | [](https://gitee.com/zhijiantianya/yudao-cloud) [](https://github.com/yudaocode/SpringBoot-Labs) | 系统学习 Spring Boot & Cloud 专栏 |
|
|
||||||
|
|
||||||
### 前端项目
|
|
||||||
|
|
||||||
| 项目 | Star | 简介 |
|
|
||||||
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
|
|
||||||
| [yudao-ui-admin-vue3](https://gitee.com/yudaocode/yudao-ui-admin-vue3) | [](https://gitee.com/yudaocode/yudao-ui-admin-vue3) [](https://github.com/yudaocode/yudao-ui-admin-vue3) | 基于 Vue3 + element-plus 实现的管理后台 |
|
|
||||||
| [yudao-ui-admin-vben](https://gitee.com/yudaocode/yudao-ui-admin-vben) | [](https://gitee.com/yudaocode/yudao-ui-admin-vben) [](https://github.com/yudaocode/yudao-ui-admin-vben) | 基于 Vue3 + vben(ant-design-vue) 实现的管理后台 |
|
|
||||||
| [yudao-mall-uniapp](https://gitee.com/yudaocode/yudao-mall-uniapp) | [](https://gitee.com/yudaocode/yudao-mall-uniapp) [](https://github.com/yudaocode/yudao-mall-uniapp) | 基于 uni-app 实现的商城小程序 |
|
|
||||||
| [yudao-ui-admin-vue2](https://gitee.com/yudaocode/yudao-ui-admin-vue2) | [](https://gitee.com/yudaocode/yudao-ui-admin-vue2) [](https://github.com/yudaocode/yudao-ui-admin-vue2) | 基于 Vue2 + element-ui 实现的管理后台 |
|
|
||||||
| [yudao-ui-admin-uniapp](https://gitee.com/yudaocode/yudao-ui-admin-uniapp) | [](https://gitee.com/yudaocode/yudao-ui-admin-uniapp) [](https://github.com/yudaocode/yudao-ui-admin-uniapp) | 基于 Vue2 + element-ui 实现的管理后台 |
|
|
||||||
| [yudao-ui-go-view](https://gitee.com/yudaocode/yudao-ui-go-view) | [](https://gitee.com/yudaocode/yudao-ui-go-view) [](https://github.com/yudaocode/yudao-ui-go-view) | 基于 Vue3 + naive-ui 实现的大屏报表 |
|
|
||||||
|
|
||||||
## 😎 开源协议
|
|
||||||
|
|
||||||
**为什么推荐使用本项目?**
|
|
||||||
|
|
||||||
① 本项目采用比 Apache 2.0 更宽松的 [MIT License](https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE) 开源协议,个人与企业可 100% 免费使用,不用保留类作者、Copyright 信息。
|
|
||||||
|
|
||||||
② 代码全部开源,不会像其他项目一样,只开源部分代码,让你无法了解整个项目的架构设计。[国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,113770 行 Java 代码,42462 行代码注释。
|
|
||||||
|
|
||||||
## 🤝 项目外包
|
|
||||||
|
|
||||||
我们也是接外包滴,如果你有项目想要外包,可以微信联系【**Aix9975**】。
|
|
||||||
|
|
||||||
团队包含专业的项目经理、架构师、前端工程师、后端工程师、测试工程师、运维工程师,可以提供全流程的外包服务。
|
|
||||||
|
|
||||||
项目可以是商城、SCRM 系统、OA 系统、物流系统、ERP 系统、CMS 系统、HIS 系统、支付系统、IM 聊天、微信公众号、微信小程序等等。
|
|
||||||
|
|
||||||
## 🐼 内置功能
|
|
||||||
|
|
||||||
系统内置多种多种业务功能,可以用于快速你的业务系统:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
* 通用模块(必选):系统功能、基础设施
|
|
||||||
* 通用模块(可选):工作流程、支付系统、数据报表、会员中心
|
|
||||||
* 业务系统(按需):ERP 系统、CRM 系统、商城系统、微信公众号、AI 大模型
|
|
||||||
|
|
||||||
> 友情提示:本项目基于 RuoYi-Vue 修改,**重构优化**后端的代码,**美化**前端的界面。
|
|
||||||
>
|
|
||||||
> * 额外新增的功能,我们使用 🚀 标记。
|
|
||||||
> * 重新实现的功能,我们使用 ⭐️ 标记。
|
|
||||||
|
|
||||||
🙂 所有功能,都通过 **单元测试** 保证高质量。
|
|
||||||
|
|
||||||
### 系统功能
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|-----|-------|---------------------------------|
|
|
||||||
| | 用户管理 | 用户是系统操作者,该功能主要完成系统用户配置 |
|
|
||||||
| ⭐️ | 在线用户 | 当前系统中活跃用户状态监控,支持手动踢下线 |
|
|
||||||
| | 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 |
|
|
||||||
| | 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等,本地缓存提供性能 |
|
|
||||||
| | 部门管理 | 配置系统组织机构(公司、部门、小组),树结构展现支持数据权限 |
|
|
||||||
| | 岗位管理 | 配置系统用户所属担任职务 |
|
|
||||||
| 🚀 | 租户管理 | 配置系统租户,支持 SaaS 场景下的多租户功能 |
|
|
||||||
| 🚀 | 租户套餐 | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限 |
|
|
||||||
| | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 |
|
|
||||||
| 🚀 | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 |
|
|
||||||
| 🚀 | 邮件管理 | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台 |
|
|
||||||
| 🚀 | 站内信 | 系统内的消息通知,提供站内信模版、站内信消息 |
|
|
||||||
| 🚀 | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 |
|
|
||||||
| ⭐️ | 登录日志 | 系统登录日志记录查询,包含登录异常 |
|
|
||||||
| 🚀 | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务 |
|
|
||||||
| | 通知公告 | 系统通知公告信息发布维护 |
|
|
||||||
| 🚀 | 敏感词 | 配置系统敏感词,支持标签分组 |
|
|
||||||
| 🚀 | 应用管理 | 管理 SSO 单点登录的应用,支持多种 OAuth2 授权方式 |
|
|
||||||
| 🚀 | 地区管理 | 展示省份、城市、区镇等城市信息,支持 IP 对应城市 |
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 工作流程
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
基于 Flowable 构建,可支持信创(国产)数据库,满足中国特色流程操作:
|
|
||||||
|
|
||||||
| BPMN 设计器 | 钉钉/飞书设计器 |
|
|
||||||
|------------------------------|--------------------------------|
|
|
||||||
|  |  |
|
|
||||||
|
|
||||||
> 历经头部企业生产验证,工作流引擎须标配仿钉钉/飞书 + BPMN 双设计器!!!
|
|
||||||
>
|
|
||||||
> 前者支持轻量配置简单流程,后者实现复杂场景深度编排
|
|
||||||
|
|
||||||
| 功能列表 | 功能描述 | 是否完成 |
|
|
||||||
|------------|-------------------------------------------------------------------------------------|------|
|
|
||||||
| SIMPLE 设计器 | 仿钉钉/飞书设计器,支持拖拽搭建表单流程,10 分钟快速完成审批流程配置 | ✅ |
|
|
||||||
| BPMN 设计器 | 基于 BPMN 标准开发,适配复杂业务场景,满足多层级审批及流程自动化需求 | ✅ |
|
|
||||||
| 会签 | 同一个审批节点设置多个人(如 A、B、C 三人,三人会同时收到待办任务),需全部同意之后,审批才可到下一审批节点 | ✅ |
|
|
||||||
| 或签 | 同一个审批节点设置多个人,任意一个人处理后,就能进入下一个节点 | ✅ |
|
|
||||||
| 依次审批 | (顺序会签)同一个审批节点设置多个人(如 A、B、C 三人),三人按顺序依次收到待办,即 A 先审批,A 提交后 B 才能审批,需全部同意之后,审批才可到下一审批节点 | ✅ |
|
|
||||||
| 抄送 | 将审批结果通知给抄送人,同一个审批默认排重,不重复抄送给同一人 | ✅ |
|
|
||||||
| 驳回 | (退回)将审批重置发送给某节点,重新审批。可驳回至发起人、上一节点、任意节点 | ✅ |
|
|
||||||
| 转办 | A 转给其 B 审批,B 审批后,进入下一节点 | ✅ |
|
|
||||||
| 委派 | A 转给其 B 审批,B 审批后,转给 A,A 继续审批后进入下一节点 | ✅ |
|
|
||||||
| 加签 | 允许当前审批人根据需要,自行增加当前节点的审批人,支持向前、向后加签 | ✅ |
|
|
||||||
| 减签 | (取消加签)在当前审批人操作之前,减少审批人 | ✅ |
|
|
||||||
| 撤销 | (取消流程)流程发起人,可以对流程进行撤销处理 | ✅ |
|
|
||||||
| 终止 | 系统管理员,在任意节点终止流程实例 | ✅ |
|
|
||||||
| 表单权限 | 支持拖拉拽配置表单,每个审批节点可配置只读、编辑、隐藏权限 | ✅ |
|
|
||||||
| 超时审批 | 配置超时审批时间,超时后自动触发审批通过、不通过、驳回等操作 | ✅ |
|
|
||||||
| 自动提醒 | 配置提醒时间,到达时间后自动触发短信、邮箱、站内信等通知提醒,支持自定义重复提醒频次 | ✅ |
|
|
||||||
| 父子流程 | 主流程设置子流程节点,子流程节点会自动触发子流程。子流程结束后,主流程才会执行(继续往下下执行),支持同步子流程、异步子流程 | ✅ |
|
|
||||||
| 条件分支 | (排它分支)用于在流程中实现决策,即根据条件选择一个分支执行 | ✅ |
|
|
||||||
| 并行分支 | 允许将流程分成多条分支,不进行条件判断,所有分支都会执行 | ✅ |
|
|
||||||
| 包容分支 | (条件分支 + 并行分支的结合体)允许基于条件选择多条分支执行,但如果没有任何一个分支满足条件,则可以选择默认分支 | ✅ |
|
|
||||||
| 路由分支 | 根据条件选择一个分支执行(重定向到指定配置节点),也可以选择默认分支执行(继续往下执行) | ✅ |
|
|
||||||
| 触发节点 | 执行到该节点,触发 HTTP 请求、HTTP 回调、更新数据、删除数据等 | ✅ |
|
|
||||||
| 延迟节点 | 执行到该节点,审批等待一段时间再执行,支持固定时长、固定日期等 | ✅ |
|
|
||||||
| 拓展设置 | 流程前置/后置通知,节点(任务)前置、后置通知,流程报表,自动审批去重,自定流程编号、标题、摘要,流程报表等 | ✅ |
|
|
||||||
|
|
||||||
### 支付系统
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|-----|------|---------------------------|
|
|
||||||
| 🚀 | 应用信息 | 配置商户的应用信息,对接支付宝、微信等多个支付渠道 |
|
|
||||||
| 🚀 | 支付订单 | 查看用户发起的支付宝、微信等的【支付】订单 |
|
|
||||||
| 🚀 | 退款订单 | 查看用户发起的支付宝、微信等的【退款】订单 |
|
|
||||||
| 🚀 | 回调通知 | 查看支付回调业务的【支付】【退款】的通知结果 |
|
|
||||||
| 🚀 | 接入示例 | 提供接入支付系统的【支付】【退款】的功能实战 |
|
|
||||||
|
|
||||||
### 基础设施
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|-----|-----------|----------------------------------------------|
|
|
||||||
| 🚀 | 代码生成 | 前后端代码的生成(Java、Vue、SQL、单元测试),支持 CRUD 下载 |
|
|
||||||
| 🚀 | 系统接口 | 基于 Swagger 自动生成相关的 RESTful API 接口文档 |
|
|
||||||
| 🚀 | 数据库文档 | 基于 Screw 自动生成数据库文档,支持导出 Word、HTML、MD 格式 |
|
|
||||||
| | 表单构建 | 拖动表单元素生成相应的 HTML 代码,支持导出 JSON、Vue 文件 |
|
|
||||||
| 🚀 | 配置管理 | 对系统动态配置常用参数,支持 SpringBoot 加载 |
|
|
||||||
| ⭐️ | 定时任务 | 在线(添加、修改、删除)任务调度包含执行结果日志 |
|
|
||||||
| 🚀 | 文件服务 | 支持将文件存储到 S3(MinIO、阿里云、腾讯云、七牛云)、本地、FTP、数据库等 |
|
|
||||||
| 🚀 | WebSocket | 提供 WebSocket 接入示例,支持一对一、一对多发送方式 |
|
|
||||||
| 🚀 | API 日志 | 包括 RESTful API 访问日志、异常日志两部分,方便排查 API 相关的问题 |
|
|
||||||
| | MySQL 监控 | 监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈 |
|
|
||||||
| | Redis 监控 | 监控 Redis 数据库的使用情况,使用的 Redis Key 管理 |
|
|
||||||
| 🚀 | 消息队列 | 基于 Redis 实现消息队列,Stream 提供集群消费,Pub/Sub 提供广播消费 |
|
|
||||||
| 🚀 | Java 监控 | 基于 Spring Boot Admin 实现 Java 应用的监控 |
|
|
||||||
| 🚀 | 链路追踪 | 接入 SkyWalking 组件,实现链路追踪 |
|
|
||||||
| 🚀 | 日志中心 | 接入 SkyWalking 组件,实现日志中心 |
|
|
||||||
| 🚀 | 服务保障 | 基于 Redis 实现分布式锁、幂等、限流功能,满足高并发场景 |
|
|
||||||
| 🚀 | 日志服务 | 轻量级日志中心,查看远程服务器的日志 |
|
|
||||||
| 🚀 | 单元测试 | 基于 JUnit + Mockito 实现单元测试,保证功能的正确性、代码的质量等 |
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 数据报表
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|-----|-------|--------------------|
|
|
||||||
| 🚀 | 报表设计器 | 支持数据报表、图形报表、打印设计等 |
|
|
||||||
| 🚀 | 大屏设计器 | 拖拽生成数据大屏,内置几十种图表组件 |
|
|
||||||
|
|
||||||
### 微信公众号
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|----|--------|-------------------------------|
|
|
||||||
| 🚀 | 账号管理 | 配置接入的微信公众号,可支持多个公众号 |
|
|
||||||
| 🚀 | 数据统计 | 统计公众号的用户增减、累计用户、消息概况、接口分析等数据 |
|
|
||||||
| 🚀 | 粉丝管理 | 查看已关注、取关的粉丝列表,可对粉丝进行同步、打标签等操作 |
|
|
||||||
| 🚀 | 消息管理 | 查看粉丝发送的消息列表,可主动回复粉丝消息 |
|
|
||||||
| 🚀 | 模版消息 | 配置和发送模版消息,用于向粉丝推送通知类消息 |
|
|
||||||
| 🚀 | 自动回复 | 自动回复粉丝发送的消息,支持关注回复、消息回复、关键字回复 |
|
|
||||||
| 🚀 | 标签管理 | 对公众号的标签进行创建、查询、修改、删除等操作 |
|
|
||||||
| 🚀 | 菜单管理 | 自定义公众号的菜单,也可以从公众号同步菜单 |
|
|
||||||
| 🚀 | 素材管理 | 管理公众号的图片、语音、视频等素材,支持在线播放语音、视频 |
|
|
||||||
| 🚀 | 图文草稿箱 | 新增常用的图文素材到草稿箱,可发布到公众号 |
|
|
||||||
| 🚀 | 图文发表记录 | 查看已发布成功的图文素材,支持删除操作 |
|
|
||||||
|
|
||||||
### 商城系统
|
|
||||||
|
|
||||||
演示地址:<https://cloud.iocoder.cn/mall-preview/>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 会员中心
|
|
||||||
|
|
||||||
| | 功能 | 描述 |
|
|
||||||
|-----|------|----------------------------------|
|
|
||||||
| 🚀 | 会员管理 | 会员是 C 端的消费者,该功能用于会员的搜索与管理 |
|
|
||||||
| 🚀 | 会员标签 | 对会员的标签进行创建、查询、修改、删除等操作 |
|
|
||||||
| 🚀 | 会员等级 | 对会员的等级、成长值进行管理,可用于订单折扣等会员权益 |
|
|
||||||
| 🚀 | 会员分组 | 对会员进行分组,用于用户画像、内容推送等运营手段 |
|
|
||||||
| 🚀 | 积分签到 | 回馈给签到、消费等行为的积分,会员可订单抵现、积分兑换等途径消耗 |
|
|
||||||
|
|
||||||
### ERP 系统
|
|
||||||
|
|
||||||
演示地址:<https://cloud.iocoder.cn/erp-preview/>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### CRM 系统
|
|
||||||
|
|
||||||
演示地址:<https://cloud.iocoder.cn/crm-preview/>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### AI 大模型
|
|
||||||
|
|
||||||
演示地址:<https://cloud.iocoder.cn/ai-preview/>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 🐨 技术栈
|
|
||||||
|
|
||||||
### 微服务
|
|
||||||
|
|
||||||
| 项目 | 说明 |
|
|
||||||
|-----------------------|--------------------|
|
|
||||||
| `yudao-dependencies` | Maven 依赖版本管理 |
|
|
||||||
| `yudao-framework` | Java 框架拓展 |
|
|
||||||
| `yudao-server` | 管理后台 + 用户 APP 的服务端 |
|
|
||||||
| `yudao-module-system` | 系统功能的 Module 模块 |
|
|
||||||
| `yudao-module-member` | 会员中心的 Module 模块 |
|
|
||||||
| `yudao-module-infra` | 基础设施的 Module 模块 |
|
|
||||||
| `yudao-module-bpm` | 工作流程的 Module 模块 |
|
|
||||||
| `yudao-module-pay` | 支付系统的 Module 模块 |
|
|
||||||
| `yudao-module-mall` | 商城系统的 Module 模块 |
|
|
||||||
| `yudao-module-erp` | ERP 系统的 Module 模块 |
|
|
||||||
| `yudao-module-crm` | CRM 系统的 Module 模块 |
|
|
||||||
| `yudao-module-ai` | AI 大模型的 Module 模块 |
|
|
||||||
| `yudao-module-mp` | 微信公众号的 Module 模块 |
|
|
||||||
| `yudao-module-report` | 大屏报表 Module 模块 |
|
|
||||||
|
|
||||||
### 框架
|
|
||||||
|
|
||||||
| 框架 | 说明 | 版本 | 学习指南 |
|
|
||||||
|---------------------------------------------------------------------------------------------|------------------|------------|---------------------------------------------------------------------|
|
|
||||||
| [Spring Cloud Alibaba](https://github.com/alibaba/spring-cloud-alibaba) | 微服务框架 | 2023.0.1 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
|
|
||||||
| [Nacos](https://github.com/alibaba/nacos) | 配置中心 & 注册中心 | 2.3.2 | [文档](https://www.iocoder.cn/categories/Nacos/?yudao) |
|
|
||||||
| [RocketMQ](https://github.com/apache/rocketmq) | 消息队列 | 5.2.0 | [文档](https://www.iocoder.cn/categories/RocketMQ/?yudao) |
|
|
||||||
| [Sentinel](https://github.com/alibaba/sentinel) | 服务保障 | 1.8.6 | [文档](https://www.iocoder.cn/categories/Sentinel/?yudao) |
|
|
||||||
| [XXL Job](https://github.com/xuxueli/xxl-job) | 定时任务 | 2.4.0 | [文档](https://www.iocoder.cn/XXL-JOB/good-collection/?yudao) |
|
|
||||||
| [Spring Cloud Gateway](https://github.com/spring-cloud/spring-cloud-gateway) | 服务网关 | 4.1.0 | [文档](https://www.iocoder.cn/categories/Spring-Cloud-Gateway/?yudao) |
|
|
||||||
| [Seata](https://github.com/seata/seata) | 分布式事务 | 1.6.1 | [文档](https://www.iocoder.cn/categories/Seata/?yudao) |
|
|
||||||
| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | |
|
|
||||||
| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.23 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
|
|
||||||
| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.7 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |
|
|
||||||
| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 4.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
|
|
||||||
| [Redis](https://redis.io/) | key-value 数据库 | 5.0 / 6.0 | |
|
|
||||||
| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.32.0 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) |
|
|
||||||
| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 6.1.10 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) |
|
|
||||||
| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 6.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |
|
|
||||||
| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 8.0.1 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) |
|
|
||||||
| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 7.0.0 | [文档](https://doc.iocoder.cn/bpm/) |
|
|
||||||
| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 4.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) |
|
|
||||||
| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 9.0.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) |
|
|
||||||
| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 3.6.1 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) |
|
|
||||||
| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.17.1 | |
|
|
||||||
| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.6.3 | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) |
|
|
||||||
| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.34 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) |
|
|
||||||
| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.10.1 | - |
|
|
||||||
| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 5.7.0 | - |
|
|
||||||
|
|
||||||
## 🐷 演示图
|
|
||||||
|
|
||||||
### 系统功能
|
|
||||||
|
|
||||||
| 模块 | biu | biu | biu |
|
|
||||||
|----------|-----------------------------|---------------------------|--------------------------|
|
|
||||||
| 登录 & 首页 |  |  |  |
|
|
||||||
| 用户 & 应用 |  |  |  |
|
|
||||||
| 租户 & 套餐 |  |  | - |
|
|
||||||
| 部门 & 岗位 |  |  | - |
|
|
||||||
| 菜单 & 角色 |  |  | - |
|
|
||||||
| 审计日志 |  |  | - |
|
|
||||||
| 短信 |  |  |  |
|
|
||||||
| 字典 & 敏感词 |  |  |  |
|
|
||||||
| 错误码 & 通知 |  |  | - |
|
|
||||||
|
|
||||||
### 工作流程
|
|
||||||
|
|
||||||
| 模块 | biu | biu | biu |
|
|
||||||
|---------|---------------------------------|---------------------------------|---------------------------------|
|
|
||||||
| 流程模型 |  |  |  |
|
|
||||||
| 表单 & 分组 |  |  | - |
|
|
||||||
| 我的流程 |  |  |  |
|
|
||||||
| 待办 & 已办 |  |  |  |
|
|
||||||
| OA 请假 |  |  |  |
|
|
||||||
|
|
||||||
### 基础设施
|
|
||||||
|
|
||||||
| 模块 | biu | biu | biu |
|
|
||||||
|---------------|-------------------------------|-----------------------------|---------------------------|
|
|
||||||
| 代码生成 |  |  | - |
|
|
||||||
| 文档 |  |  | - |
|
|
||||||
| 文件 & 配置 |  |  |  |
|
|
||||||
| 定时任务 |  |  | - |
|
|
||||||
| API 日志 |  |  | - |
|
|
||||||
| MySQL & Redis |  |  | - |
|
|
||||||
| 监控平台 |  |  |  |
|
|
||||||
|
|
||||||
### 支付系统
|
|
||||||
|
|
||||||
| 模块 | biu | biu | biu |
|
|
||||||
|---------|---------------------------|---------------------------------|---------------------------------|
|
|
||||||
| 商家 & 应用 |  |  |  |
|
|
||||||
| 支付 & 退款 |  |  | --- |
|
|
||||||
### 数据报表
|
|
||||||
|
|
||||||
| 模块 | biu | biu | biu |
|
|
||||||
|-------|---------------------------------|---------------------------------|---------------------------------------|
|
|
||||||
| 报表设计器 |  |  |  |
|
|
||||||
| 大屏设计器 |  |  |  |
|
|
||||||
|
|
||||||
### 移动端(管理后台)
|
|
||||||
|
|
||||||
| biu | biu | biu |
|
|
||||||
|----------------------------------|----------------------------------|----------------------------------|
|
|
||||||
|  |  |  |
|
|
||||||
|  |  |  |
|
|
||||||
|  |  |  |
|
|
||||||
|
|
||||||
目前已经实现登录、我的、工作台、编辑资料、头像修改、密码修改、常见问题、关于我们等基础功能。
|
|
||||||
|
|||||||
101
docker-compose.yml
Normal file
101
docker-compose.yml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
# MySQL 8.0
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0
|
||||||
|
container_name: asset-mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: 123456
|
||||||
|
MYSQL_DATABASE: ruoyi-vue-pro
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- ./data/mysql:/var/lib/mysql
|
||||||
|
- ./sql:/docker-entrypoint-initdb.d
|
||||||
|
command:
|
||||||
|
- --default-authentication-plugin=mysql_native_password
|
||||||
|
- --character-set-server=utf8mb4
|
||||||
|
- --collation-server=utf8mb4_unicode_ci
|
||||||
|
networks:
|
||||||
|
- asset-network
|
||||||
|
|
||||||
|
# Redis 7.0
|
||||||
|
redis:
|
||||||
|
image: redis:7.0-alpine
|
||||||
|
container_name: asset-redis
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- ./data/redis:/data
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
networks:
|
||||||
|
- asset-network
|
||||||
|
|
||||||
|
# Nacos 2.3
|
||||||
|
nacos:
|
||||||
|
image: nacos/nacos-server:v2.3.0
|
||||||
|
container_name: asset-nacos
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MODE: standalone
|
||||||
|
SPRING_DATASOURCE_PLATFORM: mysql
|
||||||
|
MYSQL_SERVICE_HOST: mysql
|
||||||
|
MYSQL_SERVICE_PORT: 3306
|
||||||
|
MYSQL_SERVICE_DB_NAME: nacos_config
|
||||||
|
MYSQL_SERVICE_USER: root
|
||||||
|
MYSQL_SERVICE_PASSWORD: 123456
|
||||||
|
NACOS_AUTH_ENABLE: true
|
||||||
|
NACOS_AUTH_TOKEN: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||||
|
NACOS_AUTH_IDENTITY_KEY: nacos
|
||||||
|
NACOS_AUTH_IDENTITY_VALUE: nacos
|
||||||
|
JVM_XMS: 512m
|
||||||
|
JVM_XMX: 512m
|
||||||
|
ports:
|
||||||
|
- "8848:8848"
|
||||||
|
- "9848:9848"
|
||||||
|
volumes:
|
||||||
|
- ./data/nacos/logs:/home/nacos/logs
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
networks:
|
||||||
|
- asset-network
|
||||||
|
|
||||||
|
# XXL-Job 2.4
|
||||||
|
xxl-job:
|
||||||
|
image: xuxueli/xxl-job-admin:2.4.0
|
||||||
|
container_name: asset-xxl-job
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
PARAMS: >
|
||||||
|
--spring.datasource.url=jdbc:mysql://mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||||
|
--spring.datasource.username=root
|
||||||
|
--spring.datasource.password=123456
|
||||||
|
ports:
|
||||||
|
- "9090:8080"
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
networks:
|
||||||
|
- asset-network
|
||||||
|
|
||||||
|
# Nginx
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: asset-nginx
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
- ./nginx/html:/usr/share/nginx/html:ro
|
||||||
|
- ./nginx/logs:/var/log/nginx
|
||||||
|
networks:
|
||||||
|
- asset-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
asset-network:
|
||||||
|
driver: bridge
|
||||||
11
pom.xml
11
pom.xml
@@ -16,16 +16,9 @@
|
|||||||
<!-- 各种 module 拓展 -->
|
<!-- 各种 module 拓展 -->
|
||||||
<module>yudao-module-system</module>
|
<module>yudao-module-system</module>
|
||||||
<module>yudao-module-infra</module>
|
<module>yudao-module-infra</module>
|
||||||
<module>yudao-module-member</module>
|
|
||||||
<module>yudao-module-bpm</module>
|
<module>yudao-module-bpm</module>
|
||||||
<module>yudao-module-pay</module>
|
<!-- 资产管理模块 -->
|
||||||
<module>yudao-module-report</module>
|
<module>yudao-module-asset</module>
|
||||||
<module>yudao-module-mp</module>
|
|
||||||
<module>yudao-module-mall</module>
|
|
||||||
<module>yudao-module-crm</module>
|
|
||||||
<module>yudao-module-erp</module>
|
|
||||||
<module>yudao-module-ai</module>
|
|
||||||
<module>yudao-module-iot</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
|
|||||||
260
sql/asset-schema-clean.sql
Normal file
260
sql/asset-schema-clean.sql
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
CREATE TABLE `asset_truck` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`org_id` bigint NOT NULL COMMENT '所属机构',
|
||||||
|
`plate_number` varchar(20) NOT NULL COMMENT '车牌号',
|
||||||
|
`vin` varchar(50) NOT NULL COMMENT 'VIN码',
|
||||||
|
`brand` int NOT NULL COMMENT '品牌(字典)',
|
||||||
|
`model` int NOT NULL COMMENT '型号(字典)',
|
||||||
|
`color` varchar(20) DEFAULT NULL COMMENT '颜色',
|
||||||
|
`engine_num` varchar(50) DEFAULT NULL COMMENT '电机编号',
|
||||||
|
`hydrogen_capacity` int DEFAULT NULL COMMENT '氢瓶容量(L)',
|
||||||
|
`reserve_electricity` decimal(10,2) DEFAULT NULL COMMENT '储电量(kwh)',
|
||||||
|
`buy_time` datetime DEFAULT NULL COMMENT '采购时间',
|
||||||
|
`mileage` decimal(10,2) DEFAULT 0.00 COMMENT '里程数(KM)',
|
||||||
|
`truck_rent_status` int NOT NULL DEFAULT 0 COMMENT '租赁状态:0-未备车,7-已备车,1-已交车,2-已还车',
|
||||||
|
`is_operation` tinyint NOT NULL DEFAULT 0 COMMENT '是否营运:0-否,1-是',
|
||||||
|
`parking_id` bigint DEFAULT NULL COMMENT '停车场ID',
|
||||||
|
`stock_area` int DEFAULT NULL COMMENT '库存区域(字典)',
|
||||||
|
`remarks` varchar(500) DEFAULT 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`),
|
||||||
|
UNIQUE KEY `uk_vin` (`vin`,`deleted`,`tenant_id`),
|
||||||
|
KEY `idx_plate_number` (`plate_number`),
|
||||||
|
KEY `idx_org_id` (`org_id`),
|
||||||
|
KEY `idx_truck_rent_status` (`truck_rent_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆信息表';
|
||||||
|
CREATE TABLE `asset_customer` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '客户名称',
|
||||||
|
`credit_code` varchar(50) DEFAULT NULL COMMENT '统一信用代码',
|
||||||
|
`contact_name` varchar(50) DEFAULT NULL COMMENT '联系人',
|
||||||
|
`contact_phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
|
||||||
|
`contact_address` varchar(200) DEFAULT NULL COMMENT '联系地址',
|
||||||
|
`contact_email` varchar(100) DEFAULT 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`),
|
||||||
|
KEY `idx_name` (`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户信息表';
|
||||||
|
CREATE TABLE `asset_parking` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '停车场名称',
|
||||||
|
`address` varchar(200) DEFAULT NULL COMMENT '地址',
|
||||||
|
`capacity` int DEFAULT 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`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='停车场表';
|
||||||
|
CREATE TABLE `asset_check_item` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`form_code` varchar(50) NOT NULL COMMENT '所属表单:preparation-备车,take-交车,return-还车',
|
||||||
|
`category` varchar(50) NOT NULL COMMENT '检查项类别',
|
||||||
|
`code` varchar(50) NOT NULL COMMENT '检查项编码',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '检查项名称',
|
||||||
|
`data_type` int NOT NULL COMMENT '数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片',
|
||||||
|
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`required` tinyint NOT NULL DEFAULT 0 COMMENT '是否必填:0-否,1-是',
|
||||||
|
`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`),
|
||||||
|
KEY `idx_form_code` (`form_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='检查项配置表';
|
||||||
|
CREATE TABLE `asset_preparation` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`truck_id` bigint NOT NULL COMMENT '车辆ID',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-待整备,1-整备中,2-已完成',
|
||||||
|
`parking_id` bigint DEFAULT NULL COMMENT '停车场ID',
|
||||||
|
`instrument_range` decimal(10,2) DEFAULT NULL COMMENT '仪表盘里程',
|
||||||
|
`left_hydrogen` decimal(10,2) DEFAULT NULL COMMENT '剩余氢量',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢气单位(字典)',
|
||||||
|
`left_electricity` decimal(10,2) DEFAULT NULL COMMENT '剩余电量(%)',
|
||||||
|
`handler_id` bigint DEFAULT NULL COMMENT '负责人ID',
|
||||||
|
`completion_time` datetime DEFAULT NULL COMMENT '完成时间',
|
||||||
|
`next_check_date` datetime DEFAULT NULL COMMENT '下次检查日期',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_truck_id` (`truck_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='备车单表';
|
||||||
|
CREATE TABLE `asset_preparation_check_data` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`preparation_id` bigint NOT NULL COMMENT '备车单ID',
|
||||||
|
`check_item_id` bigint NOT NULL COMMENT '检查项ID',
|
||||||
|
`category` varchar(50) NOT NULL COMMENT '检查项类别',
|
||||||
|
`code` varchar(50) NOT NULL COMMENT '检查项编码',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '检查项名称',
|
||||||
|
`data_type` int NOT NULL COMMENT '数据类型',
|
||||||
|
`value` varchar(500) DEFAULT NULL COMMENT '检查值',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_preparation_id` (`preparation_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='备车检查项数据表';
|
||||||
|
CREATE TABLE `asset_contract` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`org_id` bigint NOT NULL COMMENT '签约机构',
|
||||||
|
`contract_no` varchar(50) NOT NULL COMMENT '合同编号',
|
||||||
|
`customer_id` bigint NOT NULL COMMENT '客户ID',
|
||||||
|
`project_name` varchar(200) NOT NULL COMMENT '项目名称',
|
||||||
|
`contract_type` int NOT NULL COMMENT '合同类型(字典)',
|
||||||
|
`signing_date` date NOT NULL COMMENT '生效日期',
|
||||||
|
`expire_date` date DEFAULT NULL COMMENT '结束日期',
|
||||||
|
`pay_way` int DEFAULT NULL COMMENT '付款方式(字典)',
|
||||||
|
`pay_period` int DEFAULT NULL COMMENT '付款周期(字典)',
|
||||||
|
`handover_address` varchar(200) DEFAULT NULL COMMENT '交车地点',
|
||||||
|
`bd` varchar(50) DEFAULT NULL COMMENT '业务经理',
|
||||||
|
`business_dept_id` bigint DEFAULT NULL COMMENT '业务部门ID',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-草稿,1-审批中,2-已通过,3-已拒绝,4-已作废',
|
||||||
|
`bpm_process_id` varchar(64) DEFAULT NULL COMMENT '审批流程ID',
|
||||||
|
`parent_id` bigint DEFAULT NULL COMMENT '父合同ID(变更/续签)',
|
||||||
|
`is_alter` tinyint NOT NULL DEFAULT 0 COMMENT '是否变更合同:0-否,1-是',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
UNIQUE KEY `uk_contract_no` (`contract_no`,`deleted`,`tenant_id`),
|
||||||
|
KEY `idx_customer_id` (`customer_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='合同表';
|
||||||
|
CREATE TABLE `asset_contract_truck` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`truck_id` bigint NOT NULL COMMENT '车辆ID',
|
||||||
|
`estimated_return_date` date DEFAULT NULL COMMENT '预计还车日期',
|
||||||
|
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_truck_id` (`truck_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='合同车辆关联表';
|
||||||
|
CREATE TABLE `asset_rent_task` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`contract_truck_id` bigint NOT NULL COMMENT '合同车辆ID',
|
||||||
|
`task_type` int NOT NULL COMMENT '任务类型:1-交车,2-还车,3-替换车',
|
||||||
|
`task_status` int NOT NULL DEFAULT 0 COMMENT '任务状态:0-进行中,1-已完成',
|
||||||
|
`parent_task_id` bigint DEFAULT NULL COMMENT '父任务ID',
|
||||||
|
`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`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_task_type` (`task_type`),
|
||||||
|
KEY `idx_task_status` (`task_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='租赁任务表';
|
||||||
|
CREATE TABLE `asset_take` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`task_id` bigint NOT NULL COMMENT '任务ID',
|
||||||
|
`take_name` varchar(50) NOT NULL COMMENT '提车人姓名',
|
||||||
|
`take_phone` varchar(20) NOT NULL COMMENT '提车人电话',
|
||||||
|
`take_id_no` varchar(50) NOT NULL COMMENT '提车人身份证',
|
||||||
|
`handover_user_id` bigint NOT NULL COMMENT '交车人ID',
|
||||||
|
`handover_date` datetime NOT NULL COMMENT '交车时间',
|
||||||
|
`handover_address` varchar(200) NOT NULL COMMENT '交车地点',
|
||||||
|
`business_manager` varchar(50) DEFAULT NULL COMMENT '业务经理',
|
||||||
|
`take_mileage` decimal(10,2) DEFAULT NULL COMMENT '交车里程(KM)',
|
||||||
|
`hydrogen_measure` decimal(10,2) DEFAULT NULL COMMENT '氢SOC',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢SOC单位(字典)',
|
||||||
|
`electricity` decimal(10,2) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`dashboard_pic` varchar(500) DEFAULT NULL COMMENT '仪表盘照片',
|
||||||
|
`front_pic` varchar(500) DEFAULT NULL COMMENT '正面照片',
|
||||||
|
`left_front_pic` varchar(500) DEFAULT NULL COMMENT '左前方照片',
|
||||||
|
`right_front_pic` varchar(500) DEFAULT NULL COMMENT '右前方照片',
|
||||||
|
`left_rear_pic` varchar(500) DEFAULT NULL COMMENT '左后方照片',
|
||||||
|
`right_rear_pic` varchar(500) DEFAULT NULL COMMENT '右后方照片',
|
||||||
|
`is_driving_training` tinyint DEFAULT 0 COMMENT '是否驾驶培训:0-否,1-是',
|
||||||
|
`authorizer` varchar(50) DEFAULT NULL COMMENT '授权人',
|
||||||
|
`authorizer_id_card` varchar(50) DEFAULT NULL COMMENT '授权人身份证',
|
||||||
|
`authorizer_phone` varchar(20) DEFAULT NULL COMMENT '授权人电话',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_task_id` (`task_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='交车单表';
|
||||||
|
CREATE TABLE `asset_return` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`task_id` bigint NOT NULL COMMENT '任务ID',
|
||||||
|
`return_date` datetime NOT NULL COMMENT '还车时间',
|
||||||
|
`return_mileage` decimal(10,2) DEFAULT NULL COMMENT '还车里程(KM)',
|
||||||
|
`hydrogen_measure` decimal(10,2) DEFAULT NULL COMMENT '氢SOC',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢SOC单位(字典)',
|
||||||
|
`electricity` decimal(10,2) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`return_driver` varchar(50) NOT NULL COMMENT '还车人',
|
||||||
|
`return_id_card` varchar(50) NOT NULL COMMENT '还车人身份证',
|
||||||
|
`return_phone` varchar(20) NOT NULL COMMENT '还车人电话',
|
||||||
|
`return_location_type` int DEFAULT NULL COMMENT '还车地点类型(字典)',
|
||||||
|
`return_location` varchar(200) NOT NULL COMMENT '还车地点',
|
||||||
|
`fee_amount_total` decimal(10,2) DEFAULT 0.00 COMMENT '费用金额总计',
|
||||||
|
`bill_status` int DEFAULT 0 COMMENT '账单状态:0-未付款,1-已付款',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_task_id` (`task_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='还车单表';
|
||||||
|
CREATE TABLE `asset_replace` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`contract_truck_id` bigint NOT NULL COMMENT '合同车辆ID',
|
||||||
|
`old_task_id` bigint NOT NULL COMMENT '原交车任务ID',
|
||||||
|
`old_truck_id` bigint NOT NULL COMMENT '原车辆ID',
|
||||||
|
`new_truck_id` bigint NOT NULL COMMENT '新车辆ID',
|
||||||
|
`new_task_id` bigint DEFAULT NULL COMMENT '新交车任务ID',
|
||||||
|
`replace_type` int NOT NULL COMMENT '替换类型:1-临时,2-永久',
|
||||||
|
`replace_reason_type` int DEFAULT NULL COMMENT '替换原因类型(字典)',
|
||||||
|
`replace_reason` varchar(500) DEFAULT NULL COMMENT '替换原因',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-草稿,1-审批中,2-已通过,3-已拒绝',
|
||||||
|
`bpm_process_id` varchar(64) DEFAULT NULL COMMENT '审批流程ID',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_old_truck_id` (`old_truck_id`),
|
||||||
|
KEY `idx_new_truck_id` (`new_truck_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='替换车表';
|
||||||
333
sql/asset-schema.sql
Normal file
333
sql/asset-schema.sql
Normal file
@@ -0,0 +1,333 @@
|
|||||||
|
# 资产管理系统 - 数据库设计
|
||||||
|
|
||||||
|
## 一、基础数据模块
|
||||||
|
|
||||||
|
### 1.1 车辆信息表 (asset_truck)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_truck` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`org_id` bigint NOT NULL COMMENT '所属机构',
|
||||||
|
`plate_number` varchar(20) NOT NULL COMMENT '车牌号',
|
||||||
|
`vin` varchar(50) NOT NULL COMMENT 'VIN码',
|
||||||
|
`brand` int NOT NULL COMMENT '品牌(字典)',
|
||||||
|
`model` int NOT NULL COMMENT '型号(字典)',
|
||||||
|
`color` varchar(20) DEFAULT NULL COMMENT '颜色',
|
||||||
|
`engine_num` varchar(50) DEFAULT NULL COMMENT '电机编号',
|
||||||
|
`hydrogen_capacity` int DEFAULT NULL COMMENT '氢瓶容量(L)',
|
||||||
|
`reserve_electricity` decimal(10,2) DEFAULT NULL COMMENT '储电量(kwh)',
|
||||||
|
`buy_time` datetime DEFAULT NULL COMMENT '采购时间',
|
||||||
|
`mileage` decimal(10,2) DEFAULT 0.00 COMMENT '里程数(KM)',
|
||||||
|
`truck_rent_status` int NOT NULL DEFAULT 0 COMMENT '租赁状态:0-未备车,7-已备车,1-已交车,2-已还车',
|
||||||
|
`is_operation` tinyint NOT NULL DEFAULT 0 COMMENT '是否营运:0-否,1-是',
|
||||||
|
`parking_id` bigint DEFAULT NULL COMMENT '停车场ID',
|
||||||
|
`stock_area` int DEFAULT NULL COMMENT '库存区域(字典)',
|
||||||
|
`remarks` varchar(500) DEFAULT 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`),
|
||||||
|
UNIQUE KEY `uk_vin` (`vin`,`deleted`,`tenant_id`),
|
||||||
|
KEY `idx_plate_number` (`plate_number`),
|
||||||
|
KEY `idx_org_id` (`org_id`),
|
||||||
|
KEY `idx_truck_rent_status` (`truck_rent_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆信息表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 客户信息表 (asset_customer)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_customer` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '客户名称',
|
||||||
|
`credit_code` varchar(50) DEFAULT NULL COMMENT '统一信用代码',
|
||||||
|
`contact_name` varchar(50) DEFAULT NULL COMMENT '联系人',
|
||||||
|
`contact_phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
|
||||||
|
`contact_address` varchar(200) DEFAULT NULL COMMENT '联系地址',
|
||||||
|
`contact_email` varchar(100) DEFAULT 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`),
|
||||||
|
KEY `idx_name` (`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户信息表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.3 停车场表 (asset_parking)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_parking` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '停车场名称',
|
||||||
|
`address` varchar(200) DEFAULT NULL COMMENT '地址',
|
||||||
|
`capacity` int DEFAULT 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`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='停车场表';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 二、检查项配置模块
|
||||||
|
|
||||||
|
### 2.1 检查项配置表 (asset_check_item)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_check_item` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`form_code` varchar(50) NOT NULL COMMENT '所属表单:preparation-备车,take-交车,return-还车',
|
||||||
|
`category` varchar(50) NOT NULL COMMENT '检查项类别',
|
||||||
|
`code` varchar(50) NOT NULL COMMENT '检查项编码',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '检查项名称',
|
||||||
|
`data_type` int NOT NULL COMMENT '数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片',
|
||||||
|
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`required` tinyint NOT NULL DEFAULT 0 COMMENT '是否必填:0-否,1-是',
|
||||||
|
`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`),
|
||||||
|
KEY `idx_form_code` (`form_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='检查项配置表';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 三、备车模块
|
||||||
|
|
||||||
|
### 3.1 备车单表 (asset_preparation)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_preparation` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`truck_id` bigint NOT NULL COMMENT '车辆ID',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-待整备,1-整备中,2-已完成',
|
||||||
|
`parking_id` bigint DEFAULT NULL COMMENT '停车场ID',
|
||||||
|
`instrument_range` decimal(10,2) DEFAULT NULL COMMENT '仪表盘里程',
|
||||||
|
`left_hydrogen` decimal(10,2) DEFAULT NULL COMMENT '剩余氢量',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢气单位(字典)',
|
||||||
|
`left_electricity` decimal(10,2) DEFAULT NULL COMMENT '剩余电量(%)',
|
||||||
|
`handler_id` bigint DEFAULT NULL COMMENT '负责人ID',
|
||||||
|
`completion_time` datetime DEFAULT NULL COMMENT '完成时间',
|
||||||
|
`next_check_date` datetime DEFAULT NULL COMMENT '下次检查日期',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_truck_id` (`truck_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='备车单表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.2 备车检查项数据表 (asset_preparation_check_data)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_preparation_check_data` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`preparation_id` bigint NOT NULL COMMENT '备车单ID',
|
||||||
|
`check_item_id` bigint NOT NULL COMMENT '检查项ID',
|
||||||
|
`category` varchar(50) NOT NULL COMMENT '检查项类别',
|
||||||
|
`code` varchar(50) NOT NULL COMMENT '检查项编码',
|
||||||
|
`name` varchar(100) NOT NULL COMMENT '检查项名称',
|
||||||
|
`data_type` int NOT NULL COMMENT '数据类型',
|
||||||
|
`value` varchar(500) DEFAULT NULL COMMENT '检查值',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_preparation_id` (`preparation_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='备车检查项数据表';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 四、合同模块
|
||||||
|
|
||||||
|
### 4.1 合同表 (asset_contract)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_contract` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`org_id` bigint NOT NULL COMMENT '签约机构',
|
||||||
|
`contract_no` varchar(50) NOT NULL COMMENT '合同编号',
|
||||||
|
`customer_id` bigint NOT NULL COMMENT '客户ID',
|
||||||
|
`project_name` varchar(200) NOT NULL COMMENT '项目名称',
|
||||||
|
`contract_type` int NOT NULL COMMENT '合同类型(字典)',
|
||||||
|
`signing_date` date NOT NULL COMMENT '生效日期',
|
||||||
|
`expire_date` date DEFAULT NULL COMMENT '结束日期',
|
||||||
|
`pay_way` int DEFAULT NULL COMMENT '付款方式(字典)',
|
||||||
|
`pay_period` int DEFAULT NULL COMMENT '付款周期(字典)',
|
||||||
|
`handover_address` varchar(200) DEFAULT NULL COMMENT '交车地点',
|
||||||
|
`bd` varchar(50) DEFAULT NULL COMMENT '业务经理',
|
||||||
|
`business_dept_id` bigint DEFAULT NULL COMMENT '业务部门ID',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-草稿,1-审批中,2-已通过,3-已拒绝,4-已作废',
|
||||||
|
`bpm_process_id` varchar(64) DEFAULT NULL COMMENT '审批流程ID',
|
||||||
|
`parent_id` bigint DEFAULT NULL COMMENT '父合同ID(变更/续签)',
|
||||||
|
`is_alter` tinyint NOT NULL DEFAULT 0 COMMENT '是否变更合同:0-否,1-是',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
UNIQUE KEY `uk_contract_no` (`contract_no`,`deleted`,`tenant_id`),
|
||||||
|
KEY `idx_customer_id` (`customer_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='合同表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 合同车辆关联表 (asset_contract_truck)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_contract_truck` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`truck_id` bigint NOT NULL COMMENT '车辆ID',
|
||||||
|
`estimated_return_date` date DEFAULT NULL COMMENT '预计还车日期',
|
||||||
|
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_truck_id` (`truck_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='合同车辆关联表';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 五、任务模块
|
||||||
|
|
||||||
|
### 5.1 租赁任务表 (asset_rent_task)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_rent_task` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`contract_truck_id` bigint NOT NULL COMMENT '合同车辆ID',
|
||||||
|
`task_type` int NOT NULL COMMENT '任务类型:1-交车,2-还车,3-替换车',
|
||||||
|
`task_status` int NOT NULL DEFAULT 0 COMMENT '任务状态:0-进行中,1-已完成',
|
||||||
|
`parent_task_id` bigint DEFAULT NULL COMMENT '父任务ID',
|
||||||
|
`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`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_task_type` (`task_type`),
|
||||||
|
KEY `idx_task_status` (`task_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='租赁任务表';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 六、交车/还车/替换车单据表
|
||||||
|
|
||||||
|
### 6.1 交车单表 (asset_take)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_take` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`task_id` bigint NOT NULL COMMENT '任务ID',
|
||||||
|
`take_name` varchar(50) NOT NULL COMMENT '提车人姓名',
|
||||||
|
`take_phone` varchar(20) NOT NULL COMMENT '提车人电话',
|
||||||
|
`take_id_no` varchar(50) NOT NULL COMMENT '提车人身份证',
|
||||||
|
`handover_user_id` bigint NOT NULL COMMENT '交车人ID',
|
||||||
|
`handover_date` datetime NOT NULL COMMENT '交车时间',
|
||||||
|
`handover_address` varchar(200) NOT NULL COMMENT '交车地点',
|
||||||
|
`business_manager` varchar(50) DEFAULT NULL COMMENT '业务经理',
|
||||||
|
`take_mileage` decimal(10,2) DEFAULT NULL COMMENT '交车里程(KM)',
|
||||||
|
`hydrogen_measure` decimal(10,2) DEFAULT NULL COMMENT '氢SOC',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢SOC单位(字典)',
|
||||||
|
`electricity` decimal(10,2) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`dashboard_pic` varchar(500) DEFAULT NULL COMMENT '仪表盘照片',
|
||||||
|
`front_pic` varchar(500) DEFAULT NULL COMMENT '正面照片',
|
||||||
|
`left_front_pic` varchar(500) DEFAULT NULL COMMENT '左前方照片',
|
||||||
|
`right_front_pic` varchar(500) DEFAULT NULL COMMENT '右前方照片',
|
||||||
|
`left_rear_pic` varchar(500) DEFAULT NULL COMMENT '左后方照片',
|
||||||
|
`right_rear_pic` varchar(500) DEFAULT NULL COMMENT '右后方照片',
|
||||||
|
`is_driving_training` tinyint DEFAULT 0 COMMENT '是否驾驶培训:0-否,1-是',
|
||||||
|
`authorizer` varchar(50) DEFAULT NULL COMMENT '授权人',
|
||||||
|
`authorizer_id_card` varchar(50) DEFAULT NULL COMMENT '授权人身份证',
|
||||||
|
`authorizer_phone` varchar(20) DEFAULT NULL COMMENT '授权人电话',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_task_id` (`task_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='交车单表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.2 还车单表 (asset_return)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_return` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`task_id` bigint NOT NULL COMMENT '任务ID',
|
||||||
|
`return_date` datetime NOT NULL COMMENT '还车时间',
|
||||||
|
`return_mileage` decimal(10,2) DEFAULT NULL COMMENT '还车里程(KM)',
|
||||||
|
`hydrogen_measure` decimal(10,2) DEFAULT NULL COMMENT '氢SOC',
|
||||||
|
`hydrogen_unit` int DEFAULT NULL COMMENT '氢SOC单位(字典)',
|
||||||
|
`electricity` decimal(10,2) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`return_driver` varchar(50) NOT NULL COMMENT '还车人',
|
||||||
|
`return_id_card` varchar(50) NOT NULL COMMENT '还车人身份证',
|
||||||
|
`return_phone` varchar(20) NOT NULL COMMENT '还车人电话',
|
||||||
|
`return_location_type` int DEFAULT NULL COMMENT '还车地点类型(字典)',
|
||||||
|
`return_location` varchar(200) NOT NULL COMMENT '还车地点',
|
||||||
|
`fee_amount_total` decimal(10,2) DEFAULT 0.00 COMMENT '费用金额总计',
|
||||||
|
`bill_status` int DEFAULT 0 COMMENT '账单状态:0-未付款,1-已付款',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_task_id` (`task_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='还车单表';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.3 替换车表 (asset_replace)
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `asset_replace` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`contract_id` bigint NOT NULL COMMENT '合同ID',
|
||||||
|
`contract_truck_id` bigint NOT NULL COMMENT '合同车辆ID',
|
||||||
|
`old_task_id` bigint NOT NULL COMMENT '原交车任务ID',
|
||||||
|
`old_truck_id` bigint NOT NULL COMMENT '原车辆ID',
|
||||||
|
`new_truck_id` bigint NOT NULL COMMENT '新车辆ID',
|
||||||
|
`new_task_id` bigint DEFAULT NULL COMMENT '新交车任务ID',
|
||||||
|
`replace_type` int NOT NULL COMMENT '替换类型:1-临时,2-永久',
|
||||||
|
`replace_reason_type` int DEFAULT NULL COMMENT '替换原因类型(字典)',
|
||||||
|
`replace_reason` varchar(500) DEFAULT NULL COMMENT '替换原因',
|
||||||
|
`status` int NOT NULL DEFAULT 0 COMMENT '状态:0-草稿,1-审批中,2-已通过,3-已拒绝',
|
||||||
|
`bpm_process_id` varchar(64) DEFAULT NULL COMMENT '审批流程ID',
|
||||||
|
`remark` varchar(500) DEFAULT 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`),
|
||||||
|
KEY `idx_contract_id` (`contract_id`),
|
||||||
|
KEY `idx_old_truck_id` (`old_truck_id`),
|
||||||
|
KEY `idx_new_truck_id` (`new_truck_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='替换车表';
|
||||||
|
```
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
Target Server Version : 80200 (8.2.0)
|
Target Server Version : 80200 (8.2.0)
|
||||||
File Encoding : 65001
|
File Encoding : 65001
|
||||||
|
|
||||||
Date: 26/11/2025 22:43:12
|
Date: 14/02/2026 16:02:08
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SET NAMES utf8mb4;
|
SET NAMES utf8mb4;
|
||||||
@@ -91,7 +91,7 @@ CREATE TABLE `infra_api_error_log` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 23210 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
|
) ENGINE = InnoDB AUTO_INCREMENT = 23367 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of infra_api_error_log
|
-- Records of infra_api_error_log
|
||||||
@@ -128,7 +128,7 @@ CREATE TABLE `infra_codegen_column` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 2659 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
|
) ENGINE = InnoDB AUTO_INCREMENT = 2880 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of infra_codegen_column
|
-- Records of infra_codegen_column
|
||||||
@@ -166,7 +166,7 @@ CREATE TABLE `infra_codegen_table` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 197 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义';
|
) ENGINE = InnoDB AUTO_INCREMENT = 210 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of infra_codegen_table
|
-- Records of infra_codegen_table
|
||||||
@@ -204,7 +204,6 @@ INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `val
|
|||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (8, 'url', 2, 'SkyWalking 监控的地址', 'url.skywalking', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:57:03', b'0');
|
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (8, 'url', 2, 'SkyWalking 监控的地址', 'url.skywalking', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:57:03', b'0');
|
||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (9, 'url', 2, 'Spring Boot Admin 监控的地址', 'url.spring-boot-admin', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:52:07', b'0');
|
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (9, 'url', 2, 'Spring Boot Admin 监控的地址', 'url.spring-boot-admin', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:52:07', b'0');
|
||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (10, 'url', 2, 'Swagger 接口文档的地址', 'url.swagger', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:59:00', b'0');
|
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (10, 'url', 2, 'Swagger 接口文档的地址', 'url.swagger', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:59:00', b'0');
|
||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (11, 'ui', 2, '腾讯地图 key', 'tencent.lbs.key', 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E', b'1', '腾讯地图 key', '1', '2023-06-03 19:16:27', '1', '2023-06-03 19:16:27', b'0');
|
|
||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (12, 'test2', 2, 'test3', 'test4', 'test5', b'1', 'test6', '1', '2023-12-03 09:55:16', '1', '2025-04-06 21:00:09', b'0');
|
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (12, 'test2', 2, 'test3', 'test4', 'test5', b'1', 'test6', '1', '2023-12-03 09:55:16', '1', '2025-04-06 21:00:09', b'0');
|
||||||
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (13, '用户管理-账号初始密码', 2, '用户管理-注册开关', 'system.user.register-enabled', 'true', b'0', '', '1', '2025-04-26 17:23:41', '1', '2025-04-26 17:23:41', b'0');
|
INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (13, '用户管理-账号初始密码', 2, '用户管理-注册开关', 'system.user.register-enabled', 'true', b'0', '', '1', '2025-04-26 17:23:41', '1', '2025-04-26 17:23:41', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@@ -225,7 +224,7 @@ CREATE TABLE `infra_data_source_config` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据源配置表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据源配置表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of infra_data_source_config
|
-- Records of infra_data_source_config
|
||||||
@@ -251,7 +250,7 @@ CREATE TABLE `infra_file` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 2142 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 2163 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of infra_file
|
-- Records of infra_file
|
||||||
@@ -292,7 +291,7 @@ INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `c
|
|||||||
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (29, '本地存储(示例)', 10, 'mac/linux 使用 /,windows 使用 \\', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig\",\"basePath\":\"/Users/yunai/tmp/file\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2025-05-02 11:25:45', '1', '2025-11-24 20:57:14', b'0');
|
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (29, '本地存储(示例)', 10, 'mac/linux 使用 /,windows 使用 \\', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig\",\"basePath\":\"/Users/yunai/tmp/file\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2025-05-02 11:25:45', '1', '2025-11-24 20:57:14', b'0');
|
||||||
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (30, 'SFTP 存储(示例)', 12, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig\",\"basePath\":\"/upload\",\"domain\":\"http://127.0.0.1:48080\",\"host\":\"127.0.0.1\",\"port\":2222,\"username\":\"foo\",\"password\":\"pass\"}', '1', '2025-05-02 16:34:10', '1', '2025-11-24 20:57:14', b'0');
|
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (30, 'SFTP 存储(示例)', 12, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig\",\"basePath\":\"/upload\",\"domain\":\"http://127.0.0.1:48080\",\"host\":\"127.0.0.1\",\"port\":2222,\"username\":\"foo\",\"password\":\"pass\"}', '1', '2025-05-02 16:34:10', '1', '2025-11-24 20:57:14', b'0');
|
||||||
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (34, '七牛云存储【私有】(示例)', 20, '请换成你自己的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://t151glocd.hn-bkt.clouddn.com\",\"bucket\":\"ruoyi-vue-pro-private\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false}', '1', '2025-08-17 21:22:00', '1', '2025-11-24 20:57:14', b'0');
|
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (34, '七牛云存储【私有】(示例)', 20, '请换成你自己的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://t151glocd.hn-bkt.clouddn.com\",\"bucket\":\"ruoyi-vue-pro-private\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false}', '1', '2025-08-17 21:22:00', '1', '2025-11-24 20:57:14', b'0');
|
||||||
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (35, '1', 20, '1', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://www.baidu.com\",\"domain\":\"http://www.xxx.com\",\"bucket\":\"1\",\"accessKey\":\"2\",\"accessSecret\":\"3\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false}', '1', '2025-10-02 14:32:12', '1', '2025-11-24 20:57:14', b'0');
|
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (35, '1', 20, '1', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://www.baidu.com\",\"domain\":\"http://www.xxx.com\",\"bucket\":\"1\",\"accessKey\":\"2\",\"accessSecret\":\"3\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false,\"region\":\"1\"}', '1', '2025-10-02 14:32:12', '1', '2025-11-29 15:59:39', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -413,16 +412,16 @@ CREATE TABLE `system_dept` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 116 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '部门表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 118 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '部门表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_dept
|
-- Records of system_dept
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
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', '1', '2025-03-29 15:47:53', 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 (100, '芋道源码', 0, 0, 1, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2026-01-04 18:01:12', 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', '2025-03-29 15:49:55', 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', '2025-03-29 15:49:55', 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 (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, 1, '15888888888', 'ry@qq.com', 0, 'admin', '2021-01-05 17:03:47', '1', '2024-10-02 10:22:03', 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', '1', '2026-01-04 18:01:24', 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 (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', '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 (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 (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);
|
||||||
@@ -433,6 +432,8 @@ INSERT INTO `system_dept` (`id`, `name`, `parent_id`, `sort`, `leader_user_id`,
|
|||||||
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 (111, '顶级部门', 0, 1, NULL, NULL, NULL, 0, '113', '2022-03-07 21:44:50', '113', '2022-03-07 21:44:50', b'0', 122);
|
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 (111, '顶级部门', 0, 1, NULL, NULL, NULL, 0, '113', '2022-03-07 21:44:50', '113', '2022-03-07 21:44:50', b'0', 122);
|
||||||
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 (112, '产品部门', 101, 100, 1, NULL, NULL, 1, '1', '2023-12-02 09:45:13', '1', '2023-12-02 09:45:31', 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 (112, '产品部门', 101, 100, 1, NULL, NULL, 1, '1', '2023-12-02 09:45:13', '1', '2023-12-02 09:45:31', 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 (113, '支持部门', 102, 3, 104, NULL, NULL, 1, '1', '2023-12-02 09:47:38', '1', '2025-03-29 15:00:56', 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 (113, '支持部门', 102, 3, 104, NULL, NULL, 1, '1', '2023-12-02 09:47:38', '1', '2025-03-29 15:00:56', 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 (116, '某个子部门', 0, 1, NULL, NULL, NULL, 0, '1', '2025-12-08 14:51:12', '1', '2025-12-08 14:51:12', 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 (117, '某个子部门 2', 0, 2, NULL, NULL, NULL, 0, '1', '2025-12-08 14:51:25', '1', '2025-12-08 14:51:25', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -455,13 +456,13 @@ CREATE TABLE `system_dict_data` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 3035 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 3054 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_dict_data
|
-- Records of system_dict_data
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
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 (1, 1, '男', '1', 'system_user_sex', 0, 'default', 'A', '性别男', 'admin', '2021-01-05 17:03:48', '1', '2022-03-29 00:14:39', 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 (1, 1, '男', '1', 'system_user_sex', 0, 'primary', 'A', '性别男', 'admin', '2021-01-05 17:03:48', '1', '2025-12-10 13:19:26', 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 (2, 2, '女', '2', 'system_user_sex', 0, 'success', '', '性别女', 'admin', '2021-01-05 17:03:48', '1', '2023-11-15 23:30:37', 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 (2, 2, '女', '2', 'system_user_sex', 0, 'success', '', '性别女', 'admin', '2021-01-05 17:03:48', '1', '2023-11-15 23:30:37', 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 (8, 1, '正常', '1', 'infra_job_status', 0, 'success', '', '正常状态', 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 19:33:38', 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 (8, 1, '正常', '1', 'infra_job_status', 0, 'success', '', '正常状态', 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 19:33:38', 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 (9, 2, '暂停', '2', 'infra_job_status', 0, 'danger', '', '停用状态', 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 19:33:45', 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 (9, 2, '暂停', '2', 'infra_job_status', 0, 'danger', '', '停用状态', 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 19:33:45', b'0');
|
||||||
@@ -1060,7 +1061,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 (3000, 16, '百川智能', 'BaiChuan', 'ai_platform', 0, '', '', '', '1', '2025-03-23 12:15:46', '1', '2025-03-23 12:15:46', 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 (3000, 16, '百川智能', 'BaiChuan', 'ai_platform', 0, '', '', '', '1', '2025-03-23 12:15:46', '1', '2025-03-23 12:15:46', 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 (3001, 40, 'Vben5.0 Ant Design Schema 模版', '40', 'infra_codegen_front_type', 0, '', '', NULL, '1', '2025-04-23 21:47:47', '1', '2025-09-04 23:25:12', 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 (3001, 40, 'Vben5.0 Ant Design Schema 模版', '40', 'infra_codegen_front_type', 0, '', '', NULL, '1', '2025-04-23 21:47:47', '1', '2025-09-04 23:25:12', 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 (3002, 6, '支付宝余额', '6', 'brokerage_withdraw_type', 0, '', '', 'API 打款', '1', '2025-05-10 08:24:49', '1', '2025-05-10 08:24: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 (3002, 6, '支付宝余额', '6', 'brokerage_withdraw_type', 0, '', '', 'API 打款', '1', '2025-05-10 08:24:49', '1', '2025-05-10 08:24: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 (3003, 1, 'Alink', 'Alink', 'iot_codec_type', 0, '', '', '阿里云 Alink', '1', '2025-06-12 22:56:06', '1', '2025-06-12 23:22: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 (3004, 3, 'WARN', '3', 'iot_alert_level', 0, 'warning', '', '', '1', '2025-06-27 20:32:22', '1', '2025-06-27 20:34:31', 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 (3004, 3, 'WARN', '3', 'iot_alert_level', 0, 'warning', '', '', '1', '2025-06-27 20:32:22', '1', '2025-06-27 20:34:31', 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 (3005, 1, 'INFO', '1', 'iot_alert_level', 0, 'primary', '', '', '1', '2025-06-27 20:33:28', '1', '2025-06-27 20:34:35', 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 (3005, 1, 'INFO', '1', 'iot_alert_level', 0, 'primary', '', '', '1', '2025-06-27 20:33:28', '1', '2025-06-27 20:34:35', 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 (3006, 5, 'ERROR', '5', 'iot_alert_level', 0, 'danger', '', '', '1', '2025-06-27 20:33:50', '1', '2025-06-27 20:33:50', 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 (3006, 5, 'ERROR', '5', 'iot_alert_level', 0, 'danger', '', '', '1', '2025-06-27 20:33:50', '1', '2025-06-27 20:33:50', b'0');
|
||||||
@@ -1078,9 +1078,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 (3018, 30, '升级成功', '30', 'iot_ota_task_record_status', 0, 'success', '', '', '1', '2025-07-02 09:45:47', '1', '2025-07-02 09:45:47', 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 (3018, 30, '升级成功', '30', 'iot_ota_task_record_status', 0, 'success', '', '', '1', '2025-07-02 09:45:47', '1', '2025-07-02 09:45:47', 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 (3019, 40, '升级失败', '40', 'iot_ota_task_record_status', 0, 'danger', '', '', '1', '2025-07-02 09:46:02', '1', '2025-07-02 09:46:02', 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 (3019, 40, '升级失败', '40', 'iot_ota_task_record_status', 0, 'danger', '', '', '1', '2025-07-02 09:46:02', '1', '2025-07-02 09:46:02', 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 (3020, 50, '升级取消', '50', 'iot_ota_task_record_status', 0, 'warning', '', '', '1', '2025-07-02 09:46:09', '\"1\"', '2025-07-02 09:46:27', 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 (3020, 50, '升级取消', '50', 'iot_ota_task_record_status', 0, 'warning', '', '', '1', '2025-07-02 09:46:09', '\"1\"', '2025-07-02 09:46:27', 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 (3021, 1, 'IP 定位', '1', 'iot_location_type', 0, '', '', '', '1', '2025-07-05 09:56:46', '1', '2025-07-05 09:56:46', 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 (3022, 2, '设备上报', '2', 'iot_location_type', 0, '', '', '', '1', '2025-07-05 09:56:57', '1', '2025-07-05 09:56: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 (3023, 3, '手动定位', '3', 'iot_location_type', 0, '', '', '', '1', '2025-07-05 09:57:05', '1', '2025-07-05 09:57:05', 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 (3024, 3, '设备事件上报', '3', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:29', '1', '2025-07-06 10:28:29', 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 (3024, 3, '设备事件上报', '3', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:29', '1', '2025-07-06 10:28:29', 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 (3025, 4, '设备服务调用', '4', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:35', '1', '2025-07-06 10:28:35', 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 (3025, 4, '设备服务调用', '4', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:35', '1', '2025-07-06 10:28:35', 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 (3026, 100, '定时触发', '100', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:48', '1', '2025-07-06 10:28:48', 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 (3026, 100, '定时触发', '100', 'iot_rule_scene_trigger_type_enum', 0, '', '', '', '1', '2025-07-06 10:28:48', '1', '2025-07-06 10:28:48', b'0');
|
||||||
@@ -1093,6 +1090,21 @@ 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 (3033, 51, 'Vben5.0 Element Plus 标准模版', '51', 'infra_codegen_front_type', 0, '', '', '', '1', '2025-09-04 23:26:49', '1', '2025-09-04 23:26: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 (3033, 51, 'Vben5.0 Element Plus 标准模版', '51', 'infra_codegen_front_type', 0, '', '', '', '1', '2025-09-04 23:26:49', '1', '2025-09-04 23:26: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 (3034, 1, 'ttt', 'tt', 'iot_ota_task_record_status', 0, 'success', '', NULL, '1', '2025-09-06 00:02:21', '1', '2025-09-06 00:02:31', 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 (3034, 1, 'ttt', 'tt', 'iot_ota_task_record_status', 0, 'success', '', NULL, '1', '2025-09-06 00:02:21', '1', '2025-09-06 00:02:31', 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 (3035, 40, '支付宝小程序', '40', 'system_social_type', 0, '', '', '', '1', '2023-11-04 13:05:38', '1', '2023-11-04 13:07:16', 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 (3035, 40, '支付宝小程序', '40', 'system_social_type', 0, '', '', '', '1', '2023-11-04 13:05:38', '1', '2023-11-04 13:07:16', 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 (3036, 60, 'Admin Uniapp 移动端', '60', 'infra_codegen_front_type', 0, '', '', NULL, '1', '2025-12-16 19:25:51', '1', '2025-12-17 09:46:15', 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 (3040, 1, 'UDP', 'udp', 'iot_protocol_type', 0, '', '', 'UDP 协议', '1', '2026-02-04 00:32:47', '1', '2026-02-04 00:32:47', 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 (3041, 2, 'WebSocket', 'websocket', 'iot_protocol_type', 0, '', '', 'WebSocket 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', 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 (3042, 3, 'HTTP', 'http', 'iot_protocol_type', 0, '', '', 'HTTP 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', 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 (3043, 4, 'MQTT', 'mqtt', 'iot_protocol_type', 0, 'success', '', 'MQTT 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', 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 (3044, 5, 'EMQX', 'emqx', 'iot_protocol_type', 0, 'success', '', 'EMQX 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', 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 (3045, 6, 'CoAP', 'coap', 'iot_protocol_type', 0, '', '', 'CoAP 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', 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 (3046, 7, 'Modbus TCP Server', 'modbus_tcp_server', 'iot_protocol_type', 0, '', '', 'Modbus TCP Server 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-12 15:16:45', 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 (3047, 0, 'JSON', 'json', 'iot_serialize_type', 0, 'success', '', 'JSON 格式', '1', '2026-02-04 00:33:19', '1', '2026-02-04 00:33:19', 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 (3048, 1, '二进制', 'binary', 'iot_serialize_type', 0, 'warning', '', '二进制格式', '1', '2026-02-04 00:33:19', '1', '2026-02-04 00:33:19', 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 (3049, 8, 'Modbus TCP Client', 'modbus_tcp_client', 'iot_protocol_type', 0, '', '', 'Modbus TCP Client 协议', '1', '2026-02-08 18:29:46', '1', '2026-02-12 15:16:32', 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 (3050, 2, '边缘采集', '2', 'iot_modbus_mode', 0, 'success', '', '设备主动上报数据,无需轮询', '1', '2025-06-12 22:56:06', '1', '2026-02-09 13:03:23', 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 (3051, 1, 'Modbus TCP', '1', 'iot_modbus_frame_format', 0, 'default', '', 'MBAP 头部格式', '1', '2025-06-12 22:56:06', '1', '2025-06-12 22:56:06', 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 (3052, 2, 'Modbus RTU', '2', 'iot_modbus_frame_format', 0, 'warning', '', 'CRC16 校验格式', '1', '2025-06-12 22:56:06', '1', '2025-06-12 22:56:06', 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 (3053, 1, '云端轮询', '1', 'iot_modbus_mode', 0, 'primary', '', '网关主动轮询读取设备寄存器', '1', '2025-06-12 22:56:06', '1', '2025-06-12 22:56:06', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -1112,7 +1124,7 @@ CREATE TABLE `system_dict_type` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
|
`deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 2008 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 2012 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_dict_type
|
-- Records of system_dict_type
|
||||||
@@ -1221,14 +1233,16 @@ 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`, `deleted_time`) VALUES (1014, 'IoT 场景流转的触发类型枚举', 'iot_rule_scene_trigger_type_enum', 0, '', '1', '2025-03-20 14:59:44', '1', '2025-03-20 14:59:44', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1014, 'IoT 场景流转的触发类型枚举', 'iot_rule_scene_trigger_type_enum', 0, '', '1', '2025-03-20 14:59:44', '1', '2025-03-20 14:59:44', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1015, 'IoT 设备消息类型枚举', 'iot_device_message_type_enum', 0, '', '1', '2025-03-20 15:01:15', '1', '2025-03-20 15:01:15', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1015, 'IoT 设备消息类型枚举', 'iot_device_message_type_enum', 0, '', '1', '2025-03-20 15:01:15', '1', '2025-03-20 15:01:15', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1016, 'IoT 规则场景的触发类型枚举', 'iot_rule_scene_action_type_enum', 0, '', '1', '2025-03-28 15:26:54', '1', '2025-03-28 15:29:13', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1016, 'IoT 规则场景的触发类型枚举', 'iot_rule_scene_action_type_enum', 0, '', '1', '2025-03-28 15:26:54', '1', '2025-03-28 15:29:13', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2000, 'IoT 数据格式', 'iot_codec_type', 0, 'IoT 编解码器类型', '1', '2025-06-12 22:55:46', '1', '2025-06-12 22:55:46', b'0', '1970-01-01 00:00:00');
|
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2001, 'IoT 告警级别', 'iot_alert_level', 0, '', '1', '2025-06-27 20:30:57', '1', '2025-06-27 20:30:57', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2001, 'IoT 告警级别', 'iot_alert_level', 0, '', '1', '2025-06-27 20:30:57', '1', '2025-06-27 20:30:57', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2002, 'IoT 告警', 'iot_alert_receive_type', 0, '', '1', '2025-06-27 22:49:19', '1', '2025-06-27 22:49:19', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2002, 'IoT 告警', 'iot_alert_receive_type', 0, '', '1', '2025-06-27 22:49:19', '1', '2025-06-27 22:49:19', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2003, 'IoT 固件设备范围', 'iot_ota_task_device_scope', 0, '', '1', '2025-07-02 09:42:49', '1', '2025-07-02 09:42:49', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2003, 'IoT 固件设备范围', 'iot_ota_task_device_scope', 0, '', '1', '2025-07-02 09:42:49', '1', '2025-07-02 09:42:49', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2004, 'IoT 固件升级任务状态', 'iot_ota_task_status', 0, '', '1', '2025-07-02 09:43:43', '1', '2025-07-02 09:43:43', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2004, 'IoT 固件升级任务状态', 'iot_ota_task_status', 0, '', '1', '2025-07-02 09:43:43', '1', '2025-07-02 09:43:43', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2005, 'IoT 固件升级记录状态', 'iot_ota_task_record_status', 0, '', '1', '2025-07-02 09:45:02', '1', '2025-07-02 09:45:02', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2005, 'IoT 固件升级记录状态', 'iot_ota_task_record_status', 0, '', '1', '2025-07-02 09:45:02', '1', '2025-07-02 09:45:02', b'0', '1970-01-01 00:00:00');
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2006, 'IoT 定位类型', 'iot_location_type', 0, '', '1', '2025-07-05 09:56:25', '1', '2025-07-05 09:56:25', b'0', '1970-01-01 00:00:00');
|
|
||||||
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2007, 'AI MCP 客户端名字', 'ai_mcp_client_name', 0, '', '1', '2025-08-28 13:57:40', '1', '2025-08-28 13:57:40', b'0', '1970-01-01 00:00:00');
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2007, 'AI MCP 客户端名字', 'ai_mcp_client_name', 0, '', '1', '2025-08-28 13:57:40', '1', '2025-08-28 13:57:40', b'0', '1970-01-01 00:00:00');
|
||||||
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2008, 'IoT 协议类型', 'iot_protocol_type', 0, 'IoT 设备接入协议类型', '1', '2026-02-04 00:31:33', '1', '2026-02-04 00:31:33', b'0', '1970-01-01 00:00:00');
|
||||||
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2009, 'IoT 序列化类型', 'iot_serialize_type', 0, 'IoT 设备消息序列化类型', '1', '2026-02-04 00:33:16', '1', '2026-02-04 00:33:16', b'0', '1970-01-01 00:00:00');
|
||||||
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2010, 'IoT Modbus 工作模式', 'iot_modbus_mode', 0, 'Modbus 设备数据采集模式', '1', '2025-06-12 22:55:46', '1', '2025-06-12 22:55:46', b'0', '1970-01-01 00:00:00');
|
||||||
|
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2011, 'IoT Modbus 帧格式', 'iot_modbus_frame_format', 0, 'Modbus 数据帧协议格式', '1', '2025-06-12 22:55:46', '1', '2025-06-12 22:55:46', b'0', '1970-01-01 00:00:00');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -1252,7 +1266,7 @@ CREATE TABLE `system_login_log` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 4066 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
|
) ENGINE = InnoDB AUTO_INCREMENT = 4449 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_login_log
|
-- Records of system_login_log
|
||||||
@@ -1286,7 +1300,7 @@ CREATE TABLE `system_mail_account` (
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '7684413@qq.com', '7684413@qq.com', '1234576', '127.0.0.1', 8080, b'0', b'0', '1', '2023-01-25 17:39:52', '1', '2025-04-04 16:34:40', b'0');
|
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '7684413@qq.com', '7684413@qq.com', '1234576', '127.0.0.1', 8080, b'0', b'0', '1', '2023-01-25 17:39:52', '1', '2025-04-04 16:34:40', b'0');
|
||||||
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, 'ydym_test@163.com', 'ydym_test@163.com', 'WBZTEINMIFVRYSOE', 'smtp.163.com', 465, b'1', b'0', '1', '2023-01-26 01:26:03', '1', '2025-07-26 21:57:55', b'0');
|
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, 'ydym_test@163.com', 'ydym_test@163.com', 'WBZTEINMIFVRYSOE', 'smtp.163.com', 465, b'1', b'0', '1', '2023-01-26 01:26:03', '1', '2025-12-20 18:09:32', b'0');
|
||||||
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3, '76854114@qq.com', '3335', '11234', 'yunai1.cn', 466, b'0', b'0', '1', '2023-01-27 15:06:38', '1', '2023-01-27 07:08:36', b'1');
|
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3, '76854114@qq.com', '3335', '11234', 'yunai1.cn', 466, b'0', b'0', '1', '2023-01-27 15:06:38', '1', '2023-01-27 07:08:36', b'1');
|
||||||
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '7685413x@qq.com', '2', '3', '4', 5, b'1', b'0', '1', '2023-04-12 23:05:06', '1', '2023-04-12 15:05:11', b'1');
|
INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `starttls_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '7685413x@qq.com', '2', '3', '4', 5, b'1', b'0', '1', '2023-04-12 23:05:06', '1', '2023-04-12 15:05:11', b'1');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@@ -1385,7 +1399,7 @@ CREATE TABLE `system_menu` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 5047 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 5049 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_menu
|
-- Records of system_menu
|
||||||
@@ -1394,8 +1408,8 @@ BEGIN;
|
|||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '系统管理', '', 1, 10, 0, '/system', 'ep:tools', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2025-03-15 21:30:27', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '系统管理', '', 1, 10, 0, '/system', 'ep:tools', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2025-03-15 21:30:27', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, '基础设施', '', 1, 20, 0, '/infra', 'ep:monitor', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-03-01 08:28:40', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, '基础设施', '', 1, 20, 0, '/infra', 'ep:monitor', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-03-01 08:28:40', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5, 'OA 示例', '', 1, 40, 1185, 'oa', 'fa:road', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-09-20 16:26:19', '1', '2024-02-29 12:38:13', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5, 'OA 示例', '', 1, 40, 1185, 'oa', 'fa:road', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2021-09-20 16:26:19', '1', '2024-02-29 12:38:13', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'ep:avatar', 'system/user/index', 'SystemUser', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2025-03-15 21:30:41', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'ep:avatar', 'system/user/index', 'SystemUser', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2026-01-01 18:43:01', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'ep:user', 'system/role/index', 'SystemRole', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-05-01 18:35:29', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'ep:user', 'system/role/index', 'SystemRole', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2026-01-05 19:30:33', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'ep:menu', 'system/menu/index', 'SystemMenu', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:03:50', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'ep:menu', 'system/menu/index', 'SystemMenu', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:03:50', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (103, '部门管理', '', 2, 4, 1, 'dept', 'fa:address-card', 'system/dept/index', 'SystemDept', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:28', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (103, '部门管理', '', 2, 4, 1, 'dept', 'fa:address-card', 'system/dept/index', 'SystemDept', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:28', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (104, '岗位管理', '', 2, 5, 1, 'post', 'fa:address-book-o', 'system/post/index', 'SystemPost', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:39', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (104, '岗位管理', '', 2, 5, 1, 'post', 'fa:address-book-o', 'system/post/index', 'SystemPost', 0, b'1', b'1', b'1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:39', b'0');
|
||||||
@@ -1730,7 +1744,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
|
|||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2156, '查询项目', 'report:go-view-project:query', 3, 0, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:25:53', '1', '2023-02-07 19:25:53', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2156, '查询项目', 'report:go-view-project:query', 3, 0, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:25:53', '1', '2023-02-07 19:25:53', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2157, '使用 SQL 查询数据', 'report:go-view-data:get-by-sql', 3, 3, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:26:15', '1', '2023-02-07 19:26:15', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2157, '使用 SQL 查询数据', 'report:go-view-data:get-by-sql', 3, 3, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:26:15', '1', '2023-02-07 19:26:15', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2158, '使用 HTTP 查询数据', 'report:go-view-data:get-by-http', 3, 4, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:26:35', '1', '2023-02-07 19:26:35', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2158, '使用 HTTP 查询数据', 'report:go-view-data:get-by-http', 3, 4, 2153, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2023-02-07 19:26:35', '1', '2023-02-07 19:26:35', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2159, 'Boot 开发文档', '', 1, 1, 0, 'https://doc.iocoder.cn/', 'ep:document', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:46:28', '1', '2024-07-28 11:36:48', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2159, 'Boot 开发文档', '', 1, 1, 0, 'https://doc.iocoder.cn/', 'ep:document', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:46:28', '1', '2026-01-05 19:31:07', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2160, 'Cloud 开发文档', '', 1, 2, 0, 'https://cloud.iocoder.cn', 'ep:document-copy', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:47:07', '1', '2023-12-02 21:32:29', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2160, 'Cloud 开发文档', '', 1, 2, 0, 'https://cloud.iocoder.cn', 'ep:document-copy', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:47:07', '1', '2023-12-02 21:32:29', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2161, '接入示例', '', 1, 99, 1117, 'demo', 'fa-solid:dragon', 'pay/demo/index', NULL, 0, b'1', b'1', b'1', '', '2023-02-11 14:21:42', '1', '2024-01-18 23:50:00', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2161, '接入示例', '', 1, 99, 1117, 'demo', 'fa-solid:dragon', 'pay/demo/index', NULL, 0, b'1', b'1', b'1', '', '2023-02-11 14:21:42', '1', '2024-01-18 23:50:00', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2162, '商品导出', 'product:spu:export', 3, 5, 2014, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2162, '商品导出', 'product:spu:export', 3, 5, 2014, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0');
|
||||||
@@ -2141,7 +2155,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
|
|||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2722, '流程实例的查询(管理员)', 'bpm:process-instance:manager-query', 3, 1, 2721, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:18:27', '1', '2024-03-22 08:19:05', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2722, '流程实例的查询(管理员)', 'bpm:process-instance:manager-query', 3, 1, 2721, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:18:27', '1', '2024-03-22 08:19:05', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2723, '流程实例的取消(管理员)', 'bpm:process-instance:cancel-by-admin', 3, 2, 2721, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:19:25', '1', '2024-03-22 08:19:25', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2723, '流程实例的取消(管理员)', 'bpm:process-instance:cancel-by-admin', 3, 2, 2721, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:19:25', '1', '2024-03-22 08:19:25', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2724, '流程任务', '', 2, 11, 1186, 'process-tasnk', 'ep:collection-tag', 'bpm/task/manager/index', 'BpmManagerTask', 0, b'1', b'1', b'1', '1', '2024-03-22 08:43:22', '1', '2024-03-22 08:43:27', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2724, '流程任务', '', 2, 11, 1186, 'process-tasnk', 'ep:collection-tag', 'bpm/task/manager/index', 'BpmManagerTask', 0, b'1', b'1', b'1', '1', '2024-03-22 08:43:22', '1', '2024-03-22 08:43:27', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2725, '流程任务的查询(管理员)', 'bpm:task:mananger-query', 3, 1, 2724, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:43:49', '1', '2024-03-22 08:43:49', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2725, '流程任务的查询(管理员)', 'bpm:task:manager-query', 3, 1, 2724, '', '', '', '', 0, b'1', b'1', b'1', '1', '2024-03-22 08:43:49', '1', '2025-12-23 23:04:44', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2726, '流程监听器', '', 2, 5, 1186, 'process-listener', 'fa:assistive-listening-systems', 'bpm/processListener/index', 'BpmProcessListener', 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '1', '2024-03-23 13:13:38', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2726, '流程监听器', '', 2, 5, 1186, 'process-listener', 'fa:assistive-listening-systems', 'bpm/processListener/index', 'BpmProcessListener', 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '1', '2024-03-23 13:13:38', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2727, '流程监听器查询', 'bpm:process-listener:query', 3, 1, 2726, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '', '2024-03-09 16:05:34', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2727, '流程监听器查询', 'bpm:process-listener:query', 3, 1, 2726, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '', '2024-03-09 16:05:34', b'0');
|
||||||
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2728, '流程监听器创建', 'bpm:process-listener:create', 3, 2, 2726, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '', '2024-03-09 16:05:34', b'0');
|
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2728, '流程监听器创建', 'bpm:process-listener:create', 3, 2, 2726, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-03-09 16:05:34', '', '2024-03-09 16:05:34', b'0');
|
||||||
@@ -2386,13 +2400,13 @@ CREATE TABLE `system_notify_message` (
|
|||||||
-- Records of system_notify_message
|
-- Records of system_notify_message
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'1', '2025-04-21 14:59:37', '1', '2023-01-28 11:44:08', '1', '2025-04-21 14:59:37', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'1', '2025-12-15 21:24:36', '1', '2023-01-28 11:44:08', '1', '2025-12-15 21:24:36', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (3, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'1', '2025-04-21 14:59:37', '1', '2023-01-28 11:45:04', '1', '2025-04-21 14:59:37', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (3, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'1', '2025-12-15 21:24:36', '1', '2023-01-28 11:45:04', '1', '2025-12-15 21:24:36', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 103, 2, 2, 'register', '系统消息', '你好,欢迎 哈哈 加入大家庭!', 2, '{\"name\":\"哈哈\"}', b'0', NULL, '1', '2023-01-28 21:02:20', '1', '2023-01-28 21:02:20', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 103, 2, 2, 'register', '系统消息', '你好,欢迎 哈哈 加入大家庭!', 2, '{\"name\":\"哈哈\"}', b'0', NULL, '1', '2023-01-28 21:02:20', '1', '2023-01-28 21:02:20', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'1', '2025-04-21 14:59:37', '1', '2023-01-28 22:21:42', '1', '2025-04-21 14:59:37', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'1', '2025-12-08 17:25:28', '1', '2023-01-28 22:21:42', '1', '2025-12-08 17:25:28', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'1', '2025-04-21 14:59:36', '1', '2023-01-28 22:22:07', '1', '2025-04-21 14:59:36', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'1', '2025-12-08 17:25:30', '1', '2023-01-28 22:22:07', '1', '2025-12-08 17:25:30', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 1, 2, 1, 'test', '123', '我是 2,我开始 3 了', 1, '{\"name\":\"2\",\"what\":\"3\"}', b'1', '2025-04-21 14:59:35', '1', '2023-01-28 23:45:21', '1', '2025-04-21 14:59:35', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 1, 2, 1, 'test', '123', '我是 2,我开始 3 了', 1, '{\"name\":\"2\",\"what\":\"3\"}', b'1', '2025-12-08 17:25:22', '1', '2023-01-28 23:45:21', '1', '2025-12-08 17:25:22', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (8, 1, 2, 2, 'register', '系统消息', '你好,欢迎 123 加入大家庭!', 2, '{\"name\":\"123\"}', b'1', '2025-04-21 14:59:35', '1', '2023-01-28 23:50:21', '1', '2025-04-21 14:59:35', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (8, 1, 2, 2, 'register', '系统消息', '你好,欢迎 123 加入大家庭!', 2, '{\"name\":\"123\"}', b'1', '2025-12-08 16:46:01', '1', '2023-01-28 23:50:21', '1', '2025-12-08 16:46:01', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (9, 247, 1, 4, 'brokerage_withdraw_audit_approve', 'system', '您在2023-09-28 08:35:46提现¥0.09元的申请已通过审核', 2, '{\"reason\":null,\"createTime\":\"2023-09-28 08:35:46\",\"price\":\"0.09\"}', b'0', NULL, '1', '2023-09-28 16:36:22', '1', '2023-09-28 16:36:22', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (9, 247, 1, 4, 'brokerage_withdraw_audit_approve', 'system', '您在2023-09-28 08:35:46提现¥0.09元的申请已通过审核', 2, '{\"reason\":null,\"createTime\":\"2023-09-28 08:35:46\",\"price\":\"0.09\"}', b'0', NULL, '1', '2023-09-28 16:36:22', '1', '2023-09-28 16:36:22', b'0', 1);
|
||||||
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 247, 1, 4, 'brokerage_withdraw_audit_approve', 'system', '您在2023-09-30 20:59:40提现¥1.00元的申请已通过审核', 2, '{\"reason\":null,\"createTime\":\"2023-09-30 20:59:40\",\"price\":\"1.00\"}', b'0', NULL, '1', '2023-10-03 12:11:34', '1', '2023-10-03 12:11:34', b'0', 1);
|
INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 247, 1, 4, 'brokerage_withdraw_audit_approve', 'system', '您在2023-09-30 20:59:40提现¥1.00元的申请已通过审核', 2, '{\"reason\":null,\"createTime\":\"2023-09-30 20:59:40\",\"price\":\"1.00\"}', b'0', NULL, '1', '2023-10-03 12:11:34', '1', '2023-10-03 12:11:34', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@@ -2448,7 +2462,7 @@ CREATE TABLE `system_oauth2_access_token` (
|
|||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
INDEX `idx_access_token`(`access_token` ASC) USING BTREE,
|
INDEX `idx_access_token`(`access_token` ASC) USING BTREE,
|
||||||
INDEX `idx_refresh_token`(`refresh_token` ASC) USING BTREE
|
INDEX `idx_refresh_token`(`refresh_token` ASC) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 39737 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
|
) ENGINE = InnoDB AUTO_INCREMENT = 47630 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_oauth2_access_token
|
-- Records of system_oauth2_access_token
|
||||||
@@ -2516,8 +2530,8 @@ CREATE TABLE `system_oauth2_client` (
|
|||||||
-- Records of system_oauth2_client
|
-- Records of system_oauth2_client
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
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/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '[\"https://www.iocoder.cn\",\"https://doc.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\",\"client_credentials\"]', '[\"user.read\",\"user.write\"]', '[]', '[\"user.read\",\"user.write\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-08-21 10:04:50', 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/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '[\"https://www.iocoder.cn\",\"https://doc.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\",\"client_credentials\"]', '[\"user.read\",\"user.write\"]', '[]', '[\"user.read\",\"user.write\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-12-07 20:07:09', 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/xx/20250502/ed07110a37464b5299f8bd7c67ad65c7_1746187077009.jpg', '啦啦啦啦', 0, 1800, 43200, '[\"https://www.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\"]', '[\"user_info\",\"projects\"]', '[\"user_info\"]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2025-05-02 19:58:08', 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/20251227/javayuanma_1766829882970.jpg', '啦啦啦啦', 0, 1800, 43200, '[\"https://www.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\"]', '[\"user_info\",\"projects\"]', '[\"user_info\"]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2025-12-27 18:04:44', 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 (41, 'yudao-sso-demo-by-code', 'test', '基于授权码模式,如何实现 SSO 单点登录?', 'http://test.yudao.iocoder.cn/it/20250502/sign_1746181948685.png', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"authorization_code\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-09-29 13:28:31', '1', '2025-05-02 18:32:30', 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 (41, 'yudao-sso-demo-by-code', 'test', '基于授权码模式,如何实现 SSO 单点登录?', 'http://test.yudao.iocoder.cn/it/20250502/sign_1746181948685.png', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"authorization_code\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-09-29 13:28:31', '1', '2025-05-02 18:32:30', 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 (42, 'yudao-sso-demo-by-password', 'test', '基于密码模式,如何实现 SSO 单点登录?', 'http://test.yudao.iocoder.cn/20251025/images (3)_1761360515810.jpeg', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"password\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-10-04 17:40:16', '1', '2025-10-25 10:49:40', 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 (42, 'yudao-sso-demo-by-password', 'test', '基于密码模式,如何实现 SSO 单点登录?', 'http://test.yudao.iocoder.cn/20251025/images (3)_1761360515810.jpeg', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"password\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-10-04 17:40:16', '1', '2025-10-25 10:49:40', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@@ -2570,7 +2584,7 @@ CREATE TABLE `system_oauth2_refresh_token` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 2243 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
|
) ENGINE = InnoDB AUTO_INCREMENT = 2501 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_oauth2_refresh_token
|
-- Records of system_oauth2_refresh_token
|
||||||
@@ -2604,7 +2618,7 @@ CREATE TABLE `system_operate_log` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 9178 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录 V2 版本';
|
) ENGINE = InnoDB AUTO_INCREMENT = 9193 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录 V2 版本';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_operate_log
|
-- Records of system_operate_log
|
||||||
@@ -2636,7 +2650,7 @@ CREATE TABLE `system_post` (
|
|||||||
-- Records of system_post
|
-- Records of system_post
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 'se', '项目经理', 2, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2023-11-15 09:18:20', b'0', 1);
|
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 'se', '项目经理', 2, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2025-12-15 22:38:43', b'0', 1);
|
||||||
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 'user', '普通员工', 4, 0, '111222', 'admin', '2021-01-05 17:03:48', '1', '2025-03-24 21:32:40', b'0', 1);
|
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 'user', '普通员工', 4, 0, '111222', 'admin', '2021-01-05 17:03:48', '1', '2025-03-24 21:32:40', b'0', 1);
|
||||||
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 'HR', '人力资源', 5, 0, '`', '1', '2024-03-24 20:45:40', '1', '2025-03-29 19:08:10', b'0', 1);
|
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 'HR', '人力资源', 5, 0, '`', '1', '2024-03-24 20:45:40', '1', '2025-03-29 19:08:10', b'0', 1);
|
||||||
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 'test', '测试', 10, 0, NULL, '1', '2025-09-02 08:45:57', '1', '2025-09-02 08:45:57', b'0', 1);
|
INSERT INTO `system_post` (`id`, `code`, `name`, `sort`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 'test', '测试', 10, 0, NULL, '1', '2025-09-02 08:45:57', '1', '2025-09-02 08:45:57', b'0', 1);
|
||||||
@@ -2663,7 +2677,7 @@ CREATE TABLE `system_role` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 159 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色信息表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色信息表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_role
|
-- Records of system_role
|
||||||
@@ -2674,7 +2688,7 @@ INSERT INTO `system_role` (`id`, `name`, `code`, `sort`, `data_scope`, `data_sco
|
|||||||
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 (3, 'CRM 管理员', 'crm_admin', 2, 1, '', 0, 1, 'CRM 专属角色', '1', '2024-02-24 10:51:13', '1', '2024-02-24 02:51:32', 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 (3, 'CRM 管理员', 'crm_admin', 2, 1, '', 0, 1, 'CRM 专属角色', '1', '2024-02-24 10:51:13', '1', '2024-02-24 02:51:32', 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 (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 (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 (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 (155, '测试数据权限', 'test-dp', 3, 2, '[112,100,102,103,104,105,107,108]', 0, 2, '', '1', '2025-03-31 14:58:06', '1', '2025-09-06 20:15: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 (155, '测试数据权限1', 'test-dp', 4, 2, '[112,100,102,103,104,105,107,108]', 0, 2, '1111', '1', '2025-03-31 14:58:06', '1', '2025-12-04 23:29:40', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -2692,7 +2706,7 @@ CREATE TABLE `system_role_menu` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 6293 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 6352 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_role_menu
|
-- Records of system_role_menu
|
||||||
@@ -3512,6 +3526,65 @@ 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 (6290, 111, 2335, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6290, 111, 2335, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
||||||
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6291, 111, 2363, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6291, 111, 2363, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
||||||
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6292, 111, 2364, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6292, 111, 2364, '1', '2025-09-06 20:52:25', '1', '2025-09-06 20:52:25', b'0', 122);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6293, 2, 5, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6294, 2, 1118, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6295, 2, 1119, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6296, 2, 1120, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6297, 2, 2713, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6298, 2, 2714, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6299, 2, 2715, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6300, 2, 2716, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6301, 2, 2717, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6302, 2, 2718, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6303, 2, 2720, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6304, 2, 1185, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6305, 2, 2721, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6306, 2, 1186, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6307, 2, 2722, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6308, 2, 1187, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6309, 2, 2723, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6310, 2, 1188, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6311, 2, 2724, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6312, 2, 1189, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6313, 2, 2725, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6314, 2, 1190, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6315, 2, 2726, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6316, 2, 1191, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6317, 2, 2727, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6318, 2, 1192, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6319, 2, 2728, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6320, 2, 1193, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6321, 2, 2729, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6322, 2, 1194, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6323, 2, 2730, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6324, 2, 1195, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6325, 2, 2731, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6326, 2, 2732, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6327, 2, 1197, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6328, 2, 2733, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6329, 2, 1198, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6330, 2, 2734, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6331, 2, 1199, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6332, 2, 2735, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6333, 2, 1200, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6334, 2, 1201, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6335, 2, 1202, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6336, 2, 1207, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6337, 2, 1208, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6338, 2, 1209, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6339, 2, 1210, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6340, 2, 1211, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6341, 2, 1212, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6342, 2, 1213, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6343, 2, 1215, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6344, 2, 1216, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6345, 2, 1217, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6346, 2, 1218, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6347, 2, 1219, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6348, 2, 1220, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6349, 2, 1221, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6350, 2, 1222, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
|
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6351, 2, 2913, '1', '2026-01-04 18:09:41', '1', '2026-01-04 18:09:41', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3541,7 +3614,7 @@ CREATE TABLE `system_sms_channel` (
|
|||||||
BEGIN;
|
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 (2, 'Ballcat', 'ALIYUN', 0, '你要改哦,只有我可以用!!!!', 'LTAI5tCnKso2uG3kJ5gRav88', 'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, '', '2021-03-31 11:53:10', '1', '2024-08-04 08:53:26', 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', '2024-08-04 08:53:26', 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 (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 (7, 'mock腾讯云', 'TENCENT', 0, '', '1 2', '2 3', '', '1', '2024-09-30 08:53:45', '1', '2024-09-30 08:55:01', 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 (7, 'mock腾讯云', 'TENCENT', 0, '123', '1 2', '2 3', '', '1', '2024-09-30 08:53:45', '1', '2025-12-20 11:30:18', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3566,7 +3639,7 @@ CREATE TABLE `system_sms_code` (
|
|||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号'
|
INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号'
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 682 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码';
|
) ENGINE = InnoDB AUTO_INCREMENT = 690 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_sms_code
|
-- Records of system_sms_code
|
||||||
@@ -3607,7 +3680,7 @@ CREATE TABLE `system_sms_log` (
|
|||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 1528 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志';
|
) ENGINE = InnoDB AUTO_INCREMENT = 1549 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_sms_log
|
-- Records of system_sms_log
|
||||||
@@ -3670,9 +3743,9 @@ CREATE TABLE `system_social_client` (
|
|||||||
`social_type` tinyint NOT NULL COMMENT '社交平台的类型',
|
`social_type` tinyint NOT NULL COMMENT '社交平台的类型',
|
||||||
`user_type` tinyint NOT NULL COMMENT '用户类型',
|
`user_type` tinyint NOT NULL COMMENT '用户类型',
|
||||||
`client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号',
|
`client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号',
|
||||||
`client_secret` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端密钥',
|
`client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端密钥',
|
||||||
`public_key` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT 'publicKey公钥',
|
|
||||||
`agent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '代理编号',
|
`agent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '代理编号',
|
||||||
|
`public_key` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'publicKey 公钥',
|
||||||
`status` tinyint NOT NULL COMMENT '状态',
|
`status` tinyint NOT NULL COMMENT '状态',
|
||||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 '创建时间',
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
@@ -3681,18 +3754,20 @@ CREATE TABLE `system_social_client` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交客户端表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交客户端表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_social_client
|
-- Records of system_social_client
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, '钉钉', 20, 2, 'dingvrnreaje3yqvzhxg', 'i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI', NULL, 0, '', '2023-10-18 11:21:18', '1', '2023-12-20 21:28:26', b'1', 1);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, '钉钉', 20, 2, 'dingvrnreaje3yqvzhxg', 'i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI', NULL, NULL, 0, '', '2023-10-18 11:21:18', '1', '2023-12-20 21:28:26', b'1', 1);
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, '钉钉(王土豆)', 20, 2, 'dingtsu9hpepjkbmthhw', 'FP_bnSq_HAHKCSncmJjw5hxhnzs6vaVDSZZn3egj6rdqTQ_hu5tQVJyLMpgCakdP', NULL, 0, '', '2023-10-18 11:21:18', '', '2023-12-20 21:28:26', b'1', 121);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, '钉钉(王土豆)', 20, 2, 'dingtsu9hpepjkbmthhw', 'FP_bnSq_HAHKCSncmJjw5hxhnzs6vaVDSZZn3egj6rdqTQ_hu5tQVJyLMpgCakdP', NULL, NULL, 0, '', '2023-10-18 11:21:18', '', '2023-12-20 21:28:26', b'1', 121);
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (3, '微信公众号', 31, 1, 'wx5b23ba7a5589ecbb', '2a7b3b20c537e52e74afd395eb85f61f', NULL, 0, '', '2023-10-18 16:07:46', '1', '2023-12-20 21:28:23', b'1', 1);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (3, '微信公众号', 31, 1, 'wx5b23ba7a5589ecbb', '2a7b3b20c537e52e74afd395eb85f61f', NULL, NULL, 0, '', '2023-10-18 16:07:46', '1', '2023-12-20 21:28:23', b'1', 1);
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (43, '微信小程序', 34, 1, 'wx63c280fe3248a3e7', '6f270509224a7ae1296bbf1c8cb97aed', NULL, 0, '', '2023-10-19 13:37:41', '1', '2023-12-20 21:28:25', b'1', 1);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (43, '微信小程序', 34, 1, 'wx63c280fe3248a3e7', '6f270509224a7ae1296bbf1c8cb97aed', NULL, NULL, 0, '', '2023-10-19 13:37:41', '1', '2023-12-20 21:28:25', b'1', 1);
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (44, '1', 10, 1, '2', '3', NULL, 0, '1', '2025-04-06 20:36:28', '1', '2025-04-06 20:43:12', b'1', 1);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (44, '1', 10, 1, '2', '3', NULL, NULL, 0, '1', '2025-04-06 20:36:28', '1', '2025-04-06 20:43:12', b'1', 1);
|
||||||
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (45, '1', 10, 1, '2', '3', NULL, 1, '1', '2025-09-06 20:26:15', '1', '2025-09-06 20:27:55', b'1', 1);
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (45, '1', 10, 1, '2', '3', NULL, NULL, 1, '1', '2025-09-06 20:26:15', '1', '2025-09-06 20:27:55', b'1', 1);
|
||||||
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (46, '1', 10, 1, '2', '3', NULL, NULL, 0, '1', '2025-11-29 16:04:23', '1', '2025-11-29 16:04:26', b'1', 1);
|
||||||
|
INSERT INTO `system_social_client` (`id`, `name`, `social_type`, `user_type`, `client_id`, `client_secret`, `agent_id`, `public_key`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (47, '123', 10, 1, '1', '2', '3', NULL, 0, '1', '2025-12-21 10:27:02', '1', '2025-12-21 10:27:20', b'1', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3779,7 +3854,7 @@ CREATE TABLE `system_tenant` (
|
|||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'www.iocoder.cn,127.0.0.1:3000,wxc4598c446f8a9cb3', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2025-08-19 05:18:41', b'0');
|
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'www.iocoder.cn,127.0.0.1:3000,wxc4598c446f8a9cb3', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2025-08-19 05:18:41', b'0');
|
||||||
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'zsxq.iocoder.cn,123321', 111, '2026-07-10 00:00:00', 30, '1', '2022-02-22 00:56:14', '1', '2025-08-19 21:19:29', b'0');
|
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'zsxq.iocoder.cn,123321', 111, '2026-07-10 00:00:00', 30, '1', '2022-02-22 00:56:14', '1', '2025-08-19 21:19:29', b'0');
|
||||||
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'test.iocoder.cn,222,333', 111, '2022-04-29 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2025-09-06 20:44:42', b'0');
|
INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `websites`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'test.iocoder.cn,222,333', 111, '2023-04-29 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2025-12-21 09:50:00', b'0');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3822,7 +3897,7 @@ CREATE TABLE `system_user_post` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户岗位表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 130 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户岗位表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_user_post
|
-- Records of system_user_post
|
||||||
@@ -3837,6 +3912,8 @@ INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_t
|
|||||||
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (123, 115, 1, '1', '2024-04-04 09:37:14', '1', '2024-04-04 09:37:14', b'0', 1);
|
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (123, 115, 1, '1', '2024-04-04 09:37:14', '1', '2024-04-04 09:37:14', b'0', 1);
|
||||||
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (124, 115, 2, '1', '2024-04-04 09:37:14', '1', '2024-04-04 09:37:14', b'0', 1);
|
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (124, 115, 2, '1', '2024-04-04 09:37:14', '1', '2024-04-04 09:37:14', b'0', 1);
|
||||||
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (125, 1, 2, '1', '2024-07-13 22:31:39', '1', '2024-07-13 22:31:39', b'0', 1);
|
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (125, 1, 2, '1', '2024-07-13 22:31:39', '1', '2024-07-13 22:31:39', b'0', 1);
|
||||||
|
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (128, 139, 2, '1', '2025-12-05 21:43:27', '1', '2025-12-05 21:43:27', b'0', 1);
|
||||||
|
INSERT INTO `system_user_post` (`id`, `user_id`, `post_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (129, 139, 4, '1', '2025-12-05 21:43:27', '1', '2025-12-05 21:43:27', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3854,7 +3931,7 @@ CREATE TABLE `system_user_role` (
|
|||||||
`deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 51 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户和角色关联表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 55 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户和角色关联表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_user_role
|
-- Records of system_user_role
|
||||||
@@ -3877,6 +3954,10 @@ 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 (48, 100, 155, '1', '2025-04-04 10:41:14', '1', '2025-04-04 10:41:14', b'0', 1);
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (48, 100, 155, '1', '2025-04-04 10:41:14', '1', '2025-04-04 10:41:14', b'0', 1);
|
||||||
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (49, 142, 1, '1', '2025-07-23 09:11:42', '1', '2025-07-23 09:11:42', b'0', 1);
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (49, 142, 1, '1', '2025-07-23 09:11:42', '1', '2025-07-23 09:11:42', b'0', 1);
|
||||||
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (50, 142, 2, '1', '2025-10-07 20:50:37', '1', '2025-10-07 20:50:37', b'0', 1);
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (50, 142, 2, '1', '2025-10-07 20:50:37', '1', '2025-10-07 20:50:37', b'0', 1);
|
||||||
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (51, 139, 1, '1', '2025-12-05 22:36:57', '1', '2025-12-05 22:36:57', b'0', 1);
|
||||||
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (52, 139, 2, '1', '2025-12-05 22:37:00', '1', '2025-12-05 22:37:00', b'0', 1);
|
||||||
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (53, 114, 2, '1', '2026-01-04 18:15:40', '1', '2026-01-04 18:15:40', b'0', 1);
|
||||||
|
INSERT INTO `system_user_role` (`id`, `user_id`, `role_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (54, 114, 3, '1', '2026-01-04 18:16:19', '1', '2026-01-04 18:16:19', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -3905,16 +3986,16 @@ CREATE TABLE `system_users` (
|
|||||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 143 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of system_users
|
-- Records of system_users
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
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$04$KljJDa/LK7QfDm0lF5OhuePhlPfjRH3tB2Wu351Uidz.oQGJXevPi', '芋道源码', '管理员', 103, '[1,2]', '11aoteman@126.com', '18818260272', 2, 'http://test.yudao.iocoder.cn/20250921/avatar_1758423875594.png', 0, '0:0:0:0:0:0:0:1', '2025-11-22 18:50:21', 'admin', '2021-01-05 17:03:47', NULL, '2025-11-22 18:50:21', 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$04$.vd8nPeLwxt6hnSzmAoAyul8BOLX7Cib6QhcxRe30rfvrIPQHH1OG', '芋道源码', '管理员', 103, '[1,2]', '13aoteman@126.com', '18818260272', 1, 'http://test.yudao.iocoder.cn/user/avatar/20251220/blob_1766215463801.jpg', 0, '0:0:0:0:0:0:0:1', '2026-02-14 09:07:33', 'admin', '2021-01-05 17:03:47', NULL, '2026-02-14 09:07: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 (100, 'yudao', '$2a$04$h.aaPKgO.odHepnk5PCsWeEwKdojFWdTItxGKfx1r0e1CSeBzsTJ6', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2025-04-08 09:36:40', '', '2021-01-07 09:07:17', NULL, '2025-04-21 14:23:08', 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$04$h.aaPKgO.odHepnk5PCsWeEwKdojFWdTItxGKfx1r0e1CSeBzsTJ6', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2025-12-15 21:47:26', '', '2021-01-07 09:07:17', NULL, '2025-12-15 21:47:26', 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$04$fUBSmjKCPYAUmnMzOb6qE.eZCGPhHi1JmAKclODbfS/O7fHOl2bH6', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2024-08-11 17:48:12', '', '2021-01-13 23:50:35', '1', '2025-07-09 23:41:58', 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$04$fUBSmjKCPYAUmnMzOb6qE.eZCGPhHi1JmAKclODbfS/O7fHOl2bH6', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2024-08-11 17:48:12', '', '2021-01-13 23:50:35', '1', '2025-07-09 23:41:58', 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$04$BrwaYn303hjA/6TnXqdGoOLhyHOAA0bVrAFu6.1dJKycqKUnIoRz2', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2025-03-28 20:01:16', '', '2021-01-21 02:13:53', NULL, '2025-04-21 14:23:08', 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$04$BrwaYn303hjA/6TnXqdGoOLhyHOAA0bVrAFu6.1dJKycqKUnIoRz2', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2026-01-04 18:09:54', '', '2021-01-21 02:13:53', NULL, '2026-01-04 18:09:54', 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, NULL, 0, '', NULL, '1', '2022-02-20 22:59:33', '1', '2025-04-21 14:23:08', 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 (107, 'admin107', '$2a$10$dYOOBKMO93v/.ReCqzyFg.o67Tqk.bbc2bhrpyBGkIw9aypCtr2pm', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '', NULL, '1', '2022-02-20 22:59:33', '1', '2025-04-21 14:23:08', 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, NULL, 0, '', NULL, '1', '2022-02-20 23:00:50', '1', '2025-04-21 14:23:08', 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 (108, 'admin108', '$2a$10$y6mfvKoNYL1GXWak8nYwVOH.kCWqjactkzdoIDgiKl93WN3Ejg.Lu', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '', NULL, '1', '2022-02-20 23:00:50', '1', '2025-04-21 14:23:08', 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, NULL, 0, '', NULL, '1', '2022-02-20 23:11:50', '1', '2025-04-21 14:23:08', b'0', 120);
|
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, NULL, 0, '', NULL, '1', '2022-02-20 23:11:50', '1', '2025-04-21 14:23:08', b'0', 120);
|
||||||
@@ -3922,13 +4003,15 @@ 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 (111, 'test', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '测试用户', NULL, NULL, '[]', '', '', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2023-12-30 11:42:17', '110', '2022-02-23 13:14:33', NULL, '2025-04-21 14:23:08', b'0', 121);
|
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 (111, 'test', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '测试用户', NULL, NULL, '[]', '', '', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2023-12-30 11:42:17', '110', '2022-02-23 13:14:33', NULL, '2025-04-21 14:23:08', b'0', 121);
|
||||||
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$04$dB0z8Q819fJWz0hbaLe6B.VfHCjYgWx6LFfET5lyz3JwcqlyCkQ4C', '新对象', NULL, 100, '[]', '', '15601691235', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-03-16 23:11:38', '1', '2022-02-23 19:08:03', NULL, '2025-04-21 14:23:08', 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 (112, 'newobject', '$2a$04$dB0z8Q819fJWz0hbaLe6B.VfHCjYgWx6LFfET5lyz3JwcqlyCkQ4C', '新对象', NULL, 100, '[]', '', '15601691235', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-03-16 23:11:38', '1', '2022-02-23 19:08:03', NULL, '2025-04-21 14:23:08', 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', '芋道1', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '127.0.0.1', '2022-03-19 18:38:51', '1', '2022-03-07 21:37:58', '1', '2025-05-05 15:30:53', 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 (113, 'aoteman', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道1', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '127.0.0.1', '2022-03-19 18:38:51', '1', '2022-03-07 21:37:58', '1', '2025-05-05 15:30:53', 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, '[5]', '', '15601691236', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-03-24 22:21:05', '1', '2022-03-19 21:50:58', NULL, '2025-04-21 14:23:08', 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 (114, 'hrmgr', '$2a$10$TR4eybBioGRhBmDBWkqWLO6NIh3mzYa8KBKDDB5woiGYFVlRAi.fu', 'hr 小姐姐', NULL, NULL, '[5]', '', '15601691236', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2026-01-04 18:16:01', '1', '2022-03-19 21:50:58', NULL, '2026-01-04 18:16:01', 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$04$GcyP0Vyzb2F2Yni5PuIK9ueGxM0tkZGMtDwVRwrNbtMvorzbpNsV2', '阿呆', '11222', 102, '[1,2]', '7648@qq.com', '15601691229', 2, NULL, 0, '', NULL, '1', '2022-04-30 02:55:43', '1', '2025-04-21 14:23:08', 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$04$GcyP0Vyzb2F2Yni5PuIK9ueGxM0tkZGMtDwVRwrNbtMvorzbpNsV2', '阿呆', '11222', 102, '[1,2]', '7648@qq.com', '15601691229', 2, NULL, 0, '', NULL, '1', '2022-04-30 02:55:43', '1', '2025-04-21 14:23:08', 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 (117, 'admin123', '$2a$04$sEtimsHu9YCkYY4/oqElHem2Ijc9ld20eYO6lN.g/21NfLUTDLB9W', '测试号02', '1111', 100, '[2]', '', '15601691234', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-10-02 10:16:20', '1', '2022-07-09 17:40:26', '1', '2025-05-14 09:56:04', 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 (117, 'admin123', '$2a$04$sEtimsHu9YCkYY4/oqElHem2Ijc9ld20eYO6lN.g/21NfLUTDLB9W', '测试号02', '1111', 100, '[2]', '', '15601691234', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-10-02 10:16:20', '1', '2022-07-09 17:40:26', '1', '2025-05-14 09:56:04', 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 (118, 'goudan', '$2a$04$3suGZjnA6rM5bErf38u1felbgqbsPHGdRG3l9NkxPCEt2ah9Y6aJi', '狗蛋', NULL, 103, '[1]', '', '15601691239', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2025-11-23 15:28:25', '1', '2022-07-09 17:44:43', NULL, '2025-11-23 15:28:25', 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 (118, 'goudan', '$2a$04$3suGZjnA6rM5bErf38u1felbgqbsPHGdRG3l9NkxPCEt2ah9Y6aJi', '狗蛋', NULL, 103, '[1]', '', '15601691239', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2025-11-23 15:28:25', '1', '2022-07-09 17:44:43', NULL, '2025-11-23 15:28:25', 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 (139, 'wwbwwb', '$2a$04$aOHoFbQU6zfBk/1Z9raF/ugTdhjNdx7culC1HhO0zvoczAnahCiMq', '小秃头', NULL, NULL, NULL, '', '', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2024-09-10 21:03:58', NULL, '2024-09-10 21:03:58', NULL, '2025-04-21 14:23:08', 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 (139, 'wwbwwb', '$2a$04$FJLIyg8lbPytP29pbZaiU.LesJvCsYfEaHqQfB0pGQhK3e9BeZmLy', '小秃头', '123', 108, '[2,4]', '', '', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2024-09-10 21:03:58', NULL, '2024-09-10 21:03:58', '1', '2025-12-15 22:38:15', 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 (141, 'admin1', '$2a$04$oj6F6d7HrZ70kYVD3TNzEu.m3TPUzajOVuC66zdKna8KRerK1FmVa', '新用户', NULL, NULL, NULL, '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2025-04-08 13:09:07', '1', '2025-04-08 13:09:07', '1', '2025-05-14 19:11:48', 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 (141, 'admin1', '$2a$04$oj6F6d7HrZ70kYVD3TNzEu.m3TPUzajOVuC66zdKna8KRerK1FmVa', '新用户', NULL, NULL, NULL, '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2025-04-08 13:09:07', '1', '2025-04-08 13:09:07', '1', '2025-05-14 19:11:48', 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 (142, 'test01', '$2a$04$IaR0fGYtalIDURMMdcaD2.4JDWZ15ueQZwap9oPUuxkwSbL66vIRG', 'test01', '', NULL, '[]', '', '19021719925', 1, '', 0, '0:0:0:0:0:0:0:1', '2025-07-29 19:47:17', '1', '2025-07-09 21:07:10', '1', '2025-11-25 19:49:08', 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 (142, 'test01', '$2a$04$4bCYWZkjxxOC4QE0LY2M9uEEKWeJbLfs489NFtQoyidL5I0FndRaO', 'test01', '', NULL, '[]', '', '19021719925', 1, '', 0, '0:0:0:0:0:0:0:1', '2025-07-29 19:47:17', '1', '2025-07-09 21:07:10', NULL, '2025-12-02 13:23:11', 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 (143, 'a00001', '$2a$04$GhVHFviOw/SsTmiQtifHJesDYFlHMeGK7OWh7aGCCjGGVCmbHVAwa', 'a00001', NULL, 104, NULL, '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2025-12-01 16:10:13', NULL, '2025-12-01 16:10:13', '1', '2025-12-05 21:34:05', 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 (144, 'aoteman001', '$2a$04$omQOmhz8OyUFBKw77nr8KOtMp6xdvoQ1gWStjk9r8.OYT3Bv6oEYe', 'aoteman001', NULL, 116, NULL, '', '', 0, '', 1, '0:0:0:0:0:0:0:1', '2025-12-01 17:05:27', '1', '2025-12-01 17:05:27', '1', '2025-12-15 15:55:54', b'0', 1);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|||||||
17
sql/update-2026-03-11-基础数据字段补充.sql
Normal file
17
sql/update-2026-03-11-基础数据字段补充.sql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
-- 客户管理表 - 补充字段
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN company_name VARCHAR(255) COMMENT '企业名称' AFTER contact_email;
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN company_phone VARCHAR(20) COMMENT '企业电话' AFTER company_name;
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN mailing_address VARCHAR(500) COMMENT '邮寄地址' AFTER company_phone;
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN bank_name VARCHAR(255) COMMENT '开户银行' AFTER mailing_address;
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN bank_account VARCHAR(50) COMMENT '银行账号' AFTER bank_name;
|
||||||
|
ALTER TABLE asset_customer ADD COLUMN tax_number VARCHAR(50) COMMENT '纳税人识别号' AFTER bank_account;
|
||||||
|
|
||||||
|
-- 停车场管理表 - 补充字段
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN province VARCHAR(50) COMMENT '省份' AFTER capacity;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN city VARCHAR(50) COMMENT '城市' AFTER province;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN lease_start_date DATE COMMENT '租赁开始时间' AFTER city;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN lease_end_date DATE COMMENT '租赁结束时间' AFTER lease_start_date;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN manager_name VARCHAR(50) COMMENT '负责人' AFTER lease_end_date;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN manager_phone VARCHAR(20) COMMENT '负责人联系方式' AFTER manager_name;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN contact_name VARCHAR(50) COMMENT '停车场联系人' AFTER manager_phone;
|
||||||
|
ALTER TABLE asset_parking ADD COLUMN contact_phone VARCHAR(20) COMMENT '停车场联系方式' AFTER contact_name;
|
||||||
BIN
yudao-asset-cloud.tar.gz
Normal file
BIN
yudao-asset-cloud.tar.gz
Normal file
Binary file not shown.
@@ -77,6 +77,7 @@
|
|||||||
<vertx.version>4.5.22</vertx.version>
|
<vertx.version>4.5.22</vertx.version>
|
||||||
<okhttp.version>4.12.0</okhttp.version>
|
<okhttp.version>4.12.0</okhttp.version>
|
||||||
<californium.version>3.12.0</californium.version>
|
<californium.version>3.12.0</californium.version>
|
||||||
|
<j2mod.version>3.2.1</j2mod.version>
|
||||||
<!-- 三方云服务相关 -->
|
<!-- 三方云服务相关 -->
|
||||||
<awssdk.version>2.40.15</awssdk.version>
|
<awssdk.version>2.40.15</awssdk.version>
|
||||||
<justauth.version>1.16.7</justauth.version>
|
<justauth.version>1.16.7</justauth.version>
|
||||||
@@ -656,6 +657,13 @@
|
|||||||
<version>${californium.version}</version>
|
<version>${californium.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Modbus 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ghgande</groupId>
|
||||||
|
<artifactId>j2mod</artifactId>
|
||||||
|
<version>${j2mod.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 三方云服务相关 -->
|
<!-- 三方云服务相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>software.amazon.awssdk</groupId>
|
<groupId>software.amazon.awssdk</groupId>
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ public class HttpUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解码 URL 参数
|
* 解码 URL 参数(query parameter)
|
||||||
|
* 注意:此方法会将 + 解码为空格,适用于 query parameter,不适用于 URL path
|
||||||
*
|
*
|
||||||
|
* @see #decodeUrlPath(String)
|
||||||
* @param value 参数
|
* @param value 参数
|
||||||
* @return 解码后的参数
|
* @return 解码后的参数
|
||||||
*/
|
*/
|
||||||
@@ -46,6 +48,20 @@ public class HttpUtils {
|
|||||||
return URLDecoder.decode(value, StandardCharsets.UTF_8);
|
return URLDecoder.decode(value, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解码 URL 路径
|
||||||
|
* 与 {@link #decodeUtf8(String)} 不同,此方法不会将 + 解码为空格,保持 + 为字面字符
|
||||||
|
* 适用于 URL path 部分的解码
|
||||||
|
*
|
||||||
|
* @param path URL 路径
|
||||||
|
* @return 解码后的路径
|
||||||
|
*/
|
||||||
|
public static String decodeUrlPath(String path) {
|
||||||
|
// 先将 + 替换为 %2B,避免被 URLDecoder 解码为空格
|
||||||
|
String encoded = path.replace("+", "%2B");
|
||||||
|
return URLDecoder.decode(encoded, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static String replaceUrlQuery(String url, String key, String value) {
|
public static String replaceUrlQuery(String url, String key, String value) {
|
||||||
UrlBuilder builder = UrlBuilder.of(url, Charset.defaultCharset());
|
UrlBuilder builder = UrlBuilder.of(url, Charset.defaultCharset());
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
|||||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||||
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -25,44 +26,46 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
|
|||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@UtilityClass
|
||||||
public class AreaUtils {
|
public class AreaUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化 SEARCHER
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("InstantiationOfUtilityClass")
|
|
||||||
private final static AreaUtils INSTANCE = new AreaUtils();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Area 内存缓存,提升访问速度
|
* Area 内存缓存,提升访问速度
|
||||||
*/
|
*/
|
||||||
private static Map<Integer, Area> areas;
|
private static Map<Integer, Area> areas;
|
||||||
|
|
||||||
private AreaUtils() {
|
static {
|
||||||
long now = System.currentTimeMillis();
|
init();
|
||||||
areas = new HashMap<>();
|
}
|
||||||
areas.put(Area.ID_GLOBAL, new Area(Area.ID_GLOBAL, "全球", 0,
|
|
||||||
null, new ArrayList<>()));
|
|
||||||
// 从 csv 中加载数据
|
|
||||||
List<CsvRow> rows = CsvUtil.getReader().read(ResourceUtil.getUtf8Reader("area.csv")).getRows();
|
|
||||||
rows.remove(0); // 删除 header
|
|
||||||
for (CsvRow row : rows) {
|
|
||||||
// 创建 Area 对象
|
|
||||||
Area area = new Area(Integer.valueOf(row.get(0)), row.get(1), Integer.valueOf(row.get(2)),
|
|
||||||
null, new ArrayList<>());
|
|
||||||
// 添加到 areas 中
|
|
||||||
areas.put(area.getId(), area);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建父子关系:因为 Area 中没有 parentId 字段,所以需要重复读取
|
/**
|
||||||
for (CsvRow row : rows) {
|
* 初始化
|
||||||
Area area = areas.get(Integer.valueOf(row.get(0))); // 自己
|
*/
|
||||||
Area parent = areas.get(Integer.valueOf(row.get(3))); // 父
|
private static void init() {
|
||||||
Assert.isTrue(area != parent, "{}:父子节点相同", area.getName());
|
try {
|
||||||
area.setParent(parent);
|
long now = System.currentTimeMillis();
|
||||||
parent.getChildren().add(area);
|
areas = new HashMap<>();
|
||||||
|
areas.put(Area.ID_GLOBAL, new Area(Area.ID_GLOBAL, "全球", 0, null, new ArrayList<>()));
|
||||||
|
// 从 csv 中加载数据
|
||||||
|
List<CsvRow> rows = CsvUtil.getReader().read(ResourceUtil.getUtf8Reader("area.csv")).getRows();
|
||||||
|
rows.remove(0); // 删除 header
|
||||||
|
for (CsvRow row : rows) {
|
||||||
|
Area area = new Area(Integer.valueOf(row.get(0)), row.get(1), Integer.valueOf(row.get(2)), null, new ArrayList<>());
|
||||||
|
areas.put(area.getId(), area);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建父子关系:因为 Area 中没有 parentId 字段,所以需要重复读取
|
||||||
|
for (CsvRow row : rows) {
|
||||||
|
Area area = areas.get(Integer.valueOf(row.get(0))); // 自己
|
||||||
|
Area parent = areas.get(Integer.valueOf(row.get(3))); // 父
|
||||||
|
Assert.isTrue(area != parent, "{}:父子节点相同", area.getName());
|
||||||
|
area.setParent(parent);
|
||||||
|
parent.getChildren().add(area);
|
||||||
|
}
|
||||||
|
log.info("启动加载 AreaUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("AreaUtils 初始化失败", e);
|
||||||
}
|
}
|
||||||
log.info("启动加载 AreaUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ package cn.iocoder.yudao.framework.ip.core.utils;
|
|||||||
import cn.hutool.core.io.resource.ResourceUtil;
|
import cn.hutool.core.io.resource.ResourceUtil;
|
||||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.lionsoul.ip2region.xdb.Searcher;
|
import org.lionsoul.ip2region.xdb.Searcher;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP 工具类
|
* IP 工具类
|
||||||
*
|
*
|
||||||
@@ -16,30 +15,29 @@ import java.io.IOException;
|
|||||||
* @author wanglhup
|
* @author wanglhup
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@UtilityClass
|
||||||
public class IPUtils {
|
public class IPUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化 SEARCHER
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("InstantiationOfUtilityClass")
|
|
||||||
private final static IPUtils INSTANCE = new IPUtils();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP 查询器,启动加载到内存中
|
* IP 查询器,启动加载到内存中
|
||||||
*/
|
*/
|
||||||
private static Searcher SEARCHER;
|
private static Searcher SEARCHER;
|
||||||
|
|
||||||
|
static {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 私有化构造
|
* 初始化
|
||||||
*/
|
*/
|
||||||
private IPUtils() {
|
private static void init() {
|
||||||
try {
|
try {
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
byte[] bytes = ResourceUtil.readBytes("ip2region.xdb");
|
byte[] bytes = ResourceUtil.readBytes("ip2region.xdb");
|
||||||
SEARCHER = Searcher.newWithBuffer(bytes);
|
SEARCHER = Searcher.newWithBuffer(bytes);
|
||||||
log.info("启动加载 IPUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
|
log.info("启动加载 IPUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
|
||||||
} catch (IOException e) {
|
} catch (Exception e) {
|
||||||
log.error("启动加载 IPUtils 失败", e);
|
throw new RuntimeException("IPUtils 初始化失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<modules>
|
|
||||||
<module>yudao-module-ai-api</module>
|
|
||||||
<module>yudao-module-ai-server</module>
|
|
||||||
</modules>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<artifactId>yudao-module-ai</artifactId>
|
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
|
||||||
<description>
|
|
||||||
ai 模块下,接入 LLM 大模型,支持聊天、绘图、音乐、写作、思维导图等功能。
|
|
||||||
目前已接入各种模型,不限于:
|
|
||||||
国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek
|
|
||||||
国外:OpenAI、Ollama、Midjourney、StableDiffusion、Suno
|
|
||||||
</description>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-module-ai</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>yudao-module-ai-api</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
|
||||||
<description>
|
|
||||||
ai 模块 API,暴露给其它模块调用
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 参数校验 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/**
|
|
||||||
* 占位,没有特别的作用
|
|
||||||
*/
|
|
||||||
package cn.iocoder.yudao.module.ai.api;
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 内置聊天角色的枚举
|
|
||||||
*
|
|
||||||
* @author xiaoxin
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiChatRoleEnum {
|
|
||||||
|
|
||||||
AI_WRITE_ROLE("写作助手", """
|
|
||||||
你是一位出色的写作助手,能够帮助用户生成创意和灵感,并在用户提供场景和提示词时生成对应的回复。你的任务包括:
|
|
||||||
1. 撰写建议:根据用户提供的主题或问题,提供详细的写作建议、情节发展方向、角色设定以及背景描写,确保内容结构清晰、有逻辑。
|
|
||||||
2. 回复生成:根据用户提供的场景和提示词,生成合适的对话或文字回复,确保语气和风格符合场景需求。
|
|
||||||
除此之外不需要除了正文内容外的其他回复,如标题、开头、任何解释性语句或道歉。
|
|
||||||
"""),
|
|
||||||
|
|
||||||
AI_MIND_MAP_ROLE("导图助手", """
|
|
||||||
你是一位非常优秀的思维导图助手,你会把用户的所有提问都总结成思维导图,然后以 Markdown 格式输出。markdown 只需要输出一级标题,二级标题,三级标题,四级标题,最多输出四级,除此之外不要输出任何其他 markdown 标记。下面是一个合格的例子:
|
|
||||||
# Geek-AI 助手
|
|
||||||
## 完整的开源系统
|
|
||||||
### 前端开源
|
|
||||||
### 后端开源
|
|
||||||
## 支持各种大模型
|
|
||||||
### OpenAI
|
|
||||||
### Azure
|
|
||||||
### 文心一言
|
|
||||||
### 通义千问
|
|
||||||
## 集成多种收费方式
|
|
||||||
### 支付宝
|
|
||||||
### 微信
|
|
||||||
除此之外不要任何解释性语句。
|
|
||||||
"""),
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色设定
|
|
||||||
*/
|
|
||||||
private final String systemMessage;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 知识库文档切片策略枚举
|
|
||||||
*
|
|
||||||
* @author runzhen
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiDocumentSplitStrategyEnum {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自动识别文档类型并选择最佳切片策略
|
|
||||||
*/
|
|
||||||
AUTO("auto", "自动识别"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 基于 Token 数量机械切分(默认策略)
|
|
||||||
*/
|
|
||||||
TOKEN("token", "Token 切分"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按段落切分(以双换行符为分隔)
|
|
||||||
*/
|
|
||||||
PARAGRAPH("paragraph", "段落切分"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Markdown QA 格式专用切片器
|
|
||||||
* 识别二级标题作为问题,保持问答对完整性
|
|
||||||
* 长答案智能切分但保留问题作为上下文
|
|
||||||
*/
|
|
||||||
MARKDOWN_QA("markdown_qa", "Markdown QA 切分"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语义化切分,保留句子完整性
|
|
||||||
* 在段落和句子边界处切分,避免截断
|
|
||||||
*/
|
|
||||||
SEMANTIC("semantic", "语义切分");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 策略代码
|
|
||||||
*/
|
|
||||||
private final String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 策略名称
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 字典类型的枚举类
|
|
||||||
*
|
|
||||||
* @author xiaoxin
|
|
||||||
*/
|
|
||||||
public interface DictTypeConstants {
|
|
||||||
|
|
||||||
// ========== AI Write ==========
|
|
||||||
String AI_WRITE_FORMAT = "ai_write_format"; // 写作格式
|
|
||||||
String AI_WRITE_LENGTH = "ai_write_length"; // 写作长度
|
|
||||||
String AI_WRITE_LANGUAGE = "ai_write_language"; // 写作语言
|
|
||||||
String AI_WRITE_TONE = "ai_write_tone"; // 写作语气
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 错误码枚举类
|
|
||||||
* <p>
|
|
||||||
* ai 系统,使用 1-040-000-000 段
|
|
||||||
*/
|
|
||||||
public interface ErrorCodeConstants {
|
|
||||||
|
|
||||||
// ========== API 密钥 1-040-000-000 ==========
|
|
||||||
ErrorCode API_KEY_NOT_EXISTS = new ErrorCode(1_040_000_000, "API 密钥不存在");
|
|
||||||
ErrorCode API_KEY_DISABLE = new ErrorCode(1_040_000_001, "API 密钥已禁用!");
|
|
||||||
|
|
||||||
// ========== API 模型 1-040-001-000 ==========
|
|
||||||
ErrorCode MODEL_NOT_EXISTS = new ErrorCode(1_040_001_000, "模型不存在!");
|
|
||||||
ErrorCode MODEL_DISABLE = new ErrorCode(1_040_001_001, "模型({})已禁用!");
|
|
||||||
ErrorCode MODEL_DEFAULT_NOT_EXISTS = new ErrorCode(1_040_001_002, "操作失败,找不到默认模型");
|
|
||||||
ErrorCode MODEL_USE_TYPE_ERROR = new ErrorCode(1_040_001_003, "操作失败,该模型的模型类型不正确");
|
|
||||||
|
|
||||||
// ========== API 聊天角色 1-040-002-000 ==========
|
|
||||||
ErrorCode CHAT_ROLE_NOT_EXISTS = new ErrorCode(1_040_002_000, "聊天角色不存在");
|
|
||||||
ErrorCode CHAT_ROLE_DISABLE = new ErrorCode(1_040_001_001, "聊天角色({})已禁用!");
|
|
||||||
|
|
||||||
// ========== API 聊天会话 1-040-003-000 ==========
|
|
||||||
ErrorCode CHAT_CONVERSATION_NOT_EXISTS = new ErrorCode(1_040_003_000, "对话不存在!");
|
|
||||||
ErrorCode CHAT_CONVERSATION_MODEL_ERROR = new ErrorCode(1_040_003_001, "操作失败,该聊天模型的配置不完整");
|
|
||||||
|
|
||||||
// ========== API 聊天消息 1-040-004-000 ==========
|
|
||||||
ErrorCode CHAT_MESSAGE_NOT_EXIST = new ErrorCode(1_040_004_000, "消息不存在!");
|
|
||||||
ErrorCode CHAT_STREAM_ERROR = new ErrorCode(1_040_004_001, "对话生成异常!");
|
|
||||||
|
|
||||||
// ========== API 绘画 1-040-005-000 ==========
|
|
||||||
ErrorCode IMAGE_NOT_EXISTS = new ErrorCode(1_040_005_000, "图片不存在!");
|
|
||||||
ErrorCode IMAGE_MIDJOURNEY_SUBMIT_FAIL = new ErrorCode(1_040_005_001, "Midjourney 提交失败!原因:{}");
|
|
||||||
ErrorCode IMAGE_CUSTOM_ID_NOT_EXISTS = new ErrorCode(1_040_005_002, "Midjourney 按钮 customId 不存在! {}");
|
|
||||||
|
|
||||||
// ========== API 音乐 1-040-006-000 ==========
|
|
||||||
ErrorCode MUSIC_NOT_EXISTS = new ErrorCode(1_040_006_000, "音乐不存在!");
|
|
||||||
|
|
||||||
// ========== API 写作 1-040-007-000 ==========
|
|
||||||
ErrorCode WRITE_NOT_EXISTS = new ErrorCode(1_040_007_000, "作文不存在!");
|
|
||||||
ErrorCode WRITE_STREAM_ERROR = new ErrorCode(1_040_07_001, "写作生成异常!");
|
|
||||||
|
|
||||||
// ========== API 思维导图 1-040-008-000 ==========
|
|
||||||
ErrorCode MIND_MAP_NOT_EXISTS = new ErrorCode(1_040_008_000, "思维导图不存在!");
|
|
||||||
|
|
||||||
// ========== API 知识库 1-040-009-000 ==========
|
|
||||||
ErrorCode KNOWLEDGE_NOT_EXISTS = new ErrorCode(1_040_009_000, "知识库不存在!");
|
|
||||||
|
|
||||||
ErrorCode KNOWLEDGE_DOCUMENT_NOT_EXISTS = new ErrorCode(1_040_009_101, "文档不存在!");
|
|
||||||
ErrorCode KNOWLEDGE_DOCUMENT_FILE_EMPTY = new ErrorCode(1_040_009_102, "文档内容为空!");
|
|
||||||
ErrorCode KNOWLEDGE_DOCUMENT_FILE_DOWNLOAD_FAIL = new ErrorCode(1_040_009_102, "文件下载失败!");
|
|
||||||
ErrorCode KNOWLEDGE_DOCUMENT_FILE_READ_FAIL = new ErrorCode(1_040_009_102, "文档加载失败!");
|
|
||||||
|
|
||||||
ErrorCode KNOWLEDGE_SEGMENT_NOT_EXISTS = new ErrorCode(1_040_009_202, "段落不存在!");
|
|
||||||
ErrorCode KNOWLEDGE_SEGMENT_CONTENT_TOO_LONG = new ErrorCode(1_040_009_203, "内容 Token 数为 {},超过最大限制 {}");
|
|
||||||
|
|
||||||
// ========== AI 工具 1-040-010-000 ==========
|
|
||||||
ErrorCode TOOL_NOT_EXISTS = new ErrorCode(1_040_010_000, "工具不存在");
|
|
||||||
ErrorCode TOOL_NAME_NOT_EXISTS = new ErrorCode(1_040_010_001, "工具({})找不到 Bean");
|
|
||||||
|
|
||||||
// ========== AI 工作流 1-040-011-000 ==========
|
|
||||||
ErrorCode WORKFLOW_NOT_EXISTS = new ErrorCode(1_040_011_000, "工作流不存在");
|
|
||||||
ErrorCode WORKFLOW_CODE_EXISTS = new ErrorCode(1_040_011_001, "工作流标识已存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.image;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 绘画状态的枚举
|
|
||||||
*
|
|
||||||
* @author fansili
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiImageStatusEnum {
|
|
||||||
|
|
||||||
IN_PROGRESS(10, "进行中"),
|
|
||||||
SUCCESS(20, "已完成"),
|
|
||||||
FAIL(30, "已失败");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private final Integer status;
|
|
||||||
/**
|
|
||||||
* 状态名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public static AiImageStatusEnum valueOfStatus(Integer status) {
|
|
||||||
for (AiImageStatusEnum statusEnum : AiImageStatusEnum.values()) {
|
|
||||||
if (statusEnum.getStatus().equals(status)) {
|
|
||||||
return statusEnum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new IllegalArgumentException("未知会话状态: " + status);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 模型类型的枚举
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum AiModelTypeEnum implements ArrayValuable<Integer> {
|
|
||||||
|
|
||||||
CHAT(1, "对话"),
|
|
||||||
IMAGE(2, "图片"),
|
|
||||||
VOICE(3, "语音"),
|
|
||||||
VIDEO(4, "视频"),
|
|
||||||
EMBEDDING(5, "向量"),
|
|
||||||
RERANK(6, "重排序");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
private final Integer type;
|
|
||||||
/**
|
|
||||||
* 类型名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiModelTypeEnum::getType).toArray(Integer[]::new);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 模型平台
|
|
||||||
*
|
|
||||||
* @author fansili
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum AiPlatformEnum implements ArrayValuable<String> {
|
|
||||||
|
|
||||||
// ========== 国内平台 ==========
|
|
||||||
|
|
||||||
TONG_YI("TongYi", "通义千问"), // 阿里
|
|
||||||
YI_YAN("YiYan", "文心一言"), // 百度
|
|
||||||
DEEP_SEEK("DeepSeek", "DeepSeek"), // DeepSeek
|
|
||||||
ZHI_PU("ZhiPu", "智谱"), // 智谱 AI
|
|
||||||
XING_HUO("XingHuo", "星火"), // 讯飞
|
|
||||||
DOU_BAO("DouBao", "豆包"), // 字节
|
|
||||||
HUN_YUAN("HunYuan", "混元"), // 腾讯
|
|
||||||
SILICON_FLOW("SiliconFlow", "硅基流动"), // 硅基流动
|
|
||||||
MINI_MAX("MiniMax", "MiniMax"), // 稀宇科技
|
|
||||||
MOONSHOT("Moonshot", "月之暗面"), // KIMI
|
|
||||||
BAI_CHUAN("BaiChuan", "百川智能"), // 百川智能
|
|
||||||
|
|
||||||
// ========== 国外平台 ==========
|
|
||||||
|
|
||||||
OPENAI("OpenAI", "OpenAI"), // OpenAI 官方
|
|
||||||
AZURE_OPENAI("AzureOpenAI", "AzureOpenAI"), // OpenAI 微软
|
|
||||||
ANTHROPIC("Anthropic", "Anthropic"), // Anthropic Claude
|
|
||||||
GEMINI("Gemini", "Gemini"), // 谷歌 Gemini
|
|
||||||
OLLAMA("Ollama", "Ollama"),
|
|
||||||
|
|
||||||
STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI
|
|
||||||
MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney
|
|
||||||
SUNO("Suno", "Suno"), // Suno AI
|
|
||||||
GROK("Grok","Grok"), // Grok
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 平台
|
|
||||||
*/
|
|
||||||
private final String platform;
|
|
||||||
/**
|
|
||||||
* 平台名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public static final String[] ARRAYS = Arrays.stream(values()).map(AiPlatformEnum::getPlatform).toArray(String[]::new);
|
|
||||||
|
|
||||||
public static AiPlatformEnum validatePlatform(String platform) {
|
|
||||||
for (AiPlatformEnum platformEnum : AiPlatformEnum.values()) {
|
|
||||||
if (platformEnum.getPlatform().equals(platform)) {
|
|
||||||
return platformEnum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new IllegalArgumentException("非法平台: " + platform);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.music;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 音乐生成模式的枚举
|
|
||||||
*
|
|
||||||
* @author xiaoxin
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiMusicGenerateModeEnum implements ArrayValuable<Integer> {
|
|
||||||
|
|
||||||
DESCRIPTION(1, "描述模式"),
|
|
||||||
LYRIC(2, "歌词模式");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模式
|
|
||||||
*/
|
|
||||||
private final Integer mode;
|
|
||||||
/**
|
|
||||||
* 模式名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiMusicGenerateModeEnum::getMode).toArray(Integer[]::new);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.music;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 音乐状态的枚举
|
|
||||||
*
|
|
||||||
* @author xiaoxin
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiMusicStatusEnum implements ArrayValuable<Integer> {
|
|
||||||
|
|
||||||
IN_PROGRESS(10, "进行中"),
|
|
||||||
SUCCESS(20, "已完成"),
|
|
||||||
FAIL(30, "已失败");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private final Integer status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiMusicStatusEnum::getStatus).toArray(Integer[]::new);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.enums.write;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI 写作类型的枚举
|
|
||||||
*
|
|
||||||
* @author xiaoxin
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum AiWriteTypeEnum implements ArrayValuable<Integer> {
|
|
||||||
|
|
||||||
WRITING(1, "撰写", "请撰写一篇关于 [{}] 的文章。文章的内容格式:{},语气:{},语言:{},长度:{}。请确保涵盖主要内容,不需要除了正文内容外的其他回复,如标题、额外的解释或道歉。"),
|
|
||||||
REPLY(2, "回复", "请针对如下内容:[{}] 做个回复。回复内容参考:[{}], 回复格式:{},语气:{},语言:{},长度:{}。不需要除了正文内容外的其他回复,如标题、开头、额外的解释或道歉。");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
private final Integer type;
|
|
||||||
/**
|
|
||||||
* 类型名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模版
|
|
||||||
*/
|
|
||||||
private final String prompt;
|
|
||||||
|
|
||||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiWriteTypeEnum::getType).toArray(Integer[]::new);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
|
||||||
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
|
||||||
FROM eclipse-temurin:21-jre
|
|
||||||
|
|
||||||
## 创建目录,并使用它作为工作目录
|
|
||||||
RUN mkdir -p /yudao-module-ai-server
|
|
||||||
WORKDIR /yudao-module-ai-server
|
|
||||||
## 将后端项目的 Jar 文件,复制到镜像中
|
|
||||||
COPY ./target/yudao-module-ai-server.jar app.jar
|
|
||||||
|
|
||||||
## 设置 TZ 时区
|
|
||||||
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
|
|
||||||
|
|
||||||
## 暴露后端项目的 48080 端口
|
|
||||||
EXPOSE 48090
|
|
||||||
|
|
||||||
## 启动后端项目
|
|
||||||
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
|
|
||||||
@@ -1,318 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-module-ai</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>yudao-module-ai-server</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
|
||||||
<description>
|
|
||||||
ai 模块下,接入 LLM 大模型,支持聊天、绘图、音乐、写作、思维导图等功能。
|
|
||||||
目前已接入各种模型,不限于:
|
|
||||||
国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek
|
|
||||||
国外:OpenAI、Ollama、Midjourney、StableDiffusion、Suno
|
|
||||||
</description>
|
|
||||||
<properties>
|
|
||||||
<spring-ai.version>1.1.2</spring-ai.version>
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.alibaba.cloud.ai/spring-ai-alibaba -->
|
|
||||||
<alibaba-ai.version>1.1.0.0-RC2</alibaba-ai.version>
|
|
||||||
<tinyflow.version>1.2.6</tinyflow.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Cloud 基础 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 依赖服务 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-module-system-api</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-module-infra-api</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-module-ai-api</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Web 相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- DB 相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RPC 远程调用相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Registry 注册中心相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Config 配置中心相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Job 相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Test 测试相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 工具类相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 监控相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring AI Model 模型接入 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>io.swagger.core.v3</groupId>
|
|
||||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-anthropic</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-deepseek</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-ollama</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-stability-ai</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<!-- 智谱 GLM -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-zhipuai</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-model-minimax</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<!-- 通义千问 -->
|
|
||||||
<groupId>com.alibaba.cloud.ai</groupId>
|
|
||||||
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
|
||||||
<version>${alibaba-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<!-- 文心一言 -->
|
|
||||||
<groupId>org.springaicommunity</groupId>
|
|
||||||
<artifactId>qianfan-spring-boot-starter</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<!-- 月之暗面 -->
|
|
||||||
<groupId>org.springaicommunity</groupId>
|
|
||||||
<artifactId>moonshot-spring-boot-starter</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 向量存储:https://db-engines.com/en/ranking/vector+dbms -->
|
|
||||||
<dependency>
|
|
||||||
<!-- Qdrant:https://qdrant.tech/ -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-vector-store-qdrant</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<!-- Redis:https://redis.io/docs/latest/develop/get-started/vector-database/ -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-vector-store-redis</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.iocoder.cloud</groupId>
|
|
||||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<!-- Milvus:https://milvus.io/ -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-vector-store-milvus</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<!-- 解决和 logback 的日志冲突 -->
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-reload4j</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<!-- Tika:负责内容的解析 -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-tika-document-reader</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
<!-- TODO 芋艿:boot 项目里,不引入 cloud 依赖!!!另外,这样也是为了解决启动报错的问题! -->
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>spring-cloud-function-context</artifactId>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>spring-cloud-function-core</artifactId>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MCP 相关 -->
|
|
||||||
<!--
|
|
||||||
特殊说明:不能使用 spring-ai-starter-mcp-server-webflux 或 spring-ai-starter-mcp-client-webflux !!!
|
|
||||||
原因:项目使用了 SpringMVC,而不是 WebFlux。引入上述 2 个,会导致 SSE Server 失效。
|
|
||||||
-->
|
|
||||||
<dependency>
|
|
||||||
<!-- 服务端 -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>io.swagger.core.v3</groupId>
|
|
||||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<!-- 客户端 -->
|
|
||||||
<groupId>org.springframework.ai</groupId>
|
|
||||||
<artifactId>spring-ai-starter-mcp-client</artifactId>
|
|
||||||
<version>${spring-ai.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- TinyFlow:AI 工作流 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>dev.tinyflow</groupId>
|
|
||||||
<artifactId>tinyflow-java-core</artifactId>
|
|
||||||
<version>${tinyflow.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.jfinal</groupId>
|
|
||||||
<artifactId>enjoy</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<!-- 解决 https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/1318/ 问题 -->
|
|
||||||
<groupId>com.agentsflex</groupId>
|
|
||||||
<artifactId>agents-flex-store-elasticsearch</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<!-- 解决 https://t.zsxq.com/pCBZC 问题 -->
|
|
||||||
<groupId>com.agentsflex</groupId>
|
|
||||||
<artifactId>agents-flex-search-engine-es</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<!-- TODO @芋艿:暂时移除 groovy,和 iot 冲突 -->
|
|
||||||
<groupId>org.codehaus.groovy</groupId>
|
|
||||||
<artifactId>groovy-all</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<!-- 解决和 logback 的日志冲突 -->
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-simple</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-reload4j</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<!-- 设置构建的 jar 包名 -->
|
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
<plugins>
|
|
||||||
<!-- 打包 -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<version>${spring.boot.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目的启动类
|
|
||||||
* <p>
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
|
||||||
*/
|
|
||||||
@SpringBootApplication(exclude = {
|
|
||||||
org.springframework.ai.vectorstore.qdrant.autoconfigure.QdrantVectorStoreAutoConfiguration.class,
|
|
||||||
org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusVectorStoreAutoConfiguration.class,
|
|
||||||
}) // 解决 application-${profile}.yaml 配置文件下,通过 spring.autoconfigure.exclude 无法排除的问题
|
|
||||||
public class AiServerApplication {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
|
|
||||||
SpringApplication.run(AiServerApplication.class, args);
|
|
||||||
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationCreateMyReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationUpdateMyReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.chat.AiChatConversationService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.chat.AiChatMessageService;
|
|
||||||
import com.fhs.core.trans.anno.TransMethodResult;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 聊天对话")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/chat/conversation")
|
|
||||||
@Validated
|
|
||||||
public class AiChatConversationController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiChatConversationService chatConversationService;
|
|
||||||
@Resource
|
|
||||||
private AiChatMessageService chatMessageService;
|
|
||||||
|
|
||||||
@PostMapping("/create-my")
|
|
||||||
@Operation(summary = "创建【我的】聊天对话")
|
|
||||||
public CommonResult<Long> createChatConversationMy(@RequestBody @Valid AiChatConversationCreateMyReqVO createReqVO) {
|
|
||||||
return success(chatConversationService.createChatConversationMy(createReqVO, getLoginUserId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update-my")
|
|
||||||
@Operation(summary = "更新【我的】聊天对话")
|
|
||||||
public CommonResult<Boolean> updateChatConversationMy(@RequestBody @Valid AiChatConversationUpdateMyReqVO updateReqVO) {
|
|
||||||
chatConversationService.updateChatConversationMy(updateReqVO, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/my-list")
|
|
||||||
@Operation(summary = "获得【我的】聊天对话列表")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<List<AiChatConversationRespVO>> getChatConversationMyList() {
|
|
||||||
List<AiChatConversationDO> list = chatConversationService.getChatConversationListByUserId(getLoginUserId());
|
|
||||||
return success(BeanUtils.toBean(list, AiChatConversationRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-my")
|
|
||||||
@Operation(summary = "获得【我的】聊天对话")
|
|
||||||
@Parameter(name = "id", required = true, description = "对话编号", example = "1024")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<AiChatConversationRespVO> getChatConversationMy(@RequestParam("id") Long id) {
|
|
||||||
AiChatConversationDO conversation = chatConversationService.getChatConversation(id);
|
|
||||||
if (conversation != null && ObjUtil.notEqual(conversation.getUserId(), getLoginUserId())) {
|
|
||||||
conversation = null;
|
|
||||||
}
|
|
||||||
return success(BeanUtils.toBean(conversation, AiChatConversationRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-my")
|
|
||||||
@Operation(summary = "删除聊天对话")
|
|
||||||
@Parameter(name = "id", required = true, description = "对话编号", example = "1024")
|
|
||||||
public CommonResult<Boolean> deleteChatConversationMy(@RequestParam("id") Long id) {
|
|
||||||
chatConversationService.deleteChatConversationMy(id, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-by-unpinned")
|
|
||||||
@Operation(summary = "删除未置顶的聊天对话")
|
|
||||||
public CommonResult<Boolean> deleteChatConversationMyByUnpinned() {
|
|
||||||
chatConversationService.deleteChatConversationMyByUnpinned(getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 对话管理 ==========
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得对话分页", description = "用于【对话管理】菜单")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-conversation:query')")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<PageResult<AiChatConversationRespVO>> getChatConversationPage(AiChatConversationPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiChatConversationDO> pageResult = chatConversationService.getChatConversationPage(pageReqVO);
|
|
||||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
||||||
return success(PageResult.empty());
|
|
||||||
}
|
|
||||||
// 拼接关联数据
|
|
||||||
Map<Long, Integer> messageCountMap = chatMessageService.getChatMessageCountMap(
|
|
||||||
convertList(pageResult.getList(), AiChatConversationDO::getId));
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiChatConversationRespVO.class,
|
|
||||||
conversation -> conversation.setMessageCount(messageCountMap.getOrDefault(conversation.getId(), 0))));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "管理员删除对话")
|
|
||||||
@DeleteMapping("/delete-by-admin")
|
|
||||||
@Parameter(name = "id", required = true, description = "对话编号", example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-conversation:delete')")
|
|
||||||
public CommonResult<Boolean> deleteChatConversationByAdmin(@RequestParam("id") Long id) {
|
|
||||||
chatConversationService.deleteChatConversationByAdmin(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
### 发送消息(段式)
|
|
||||||
POST {{baseUrl}}/ai/chat/message/send
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"conversationId": "1781604279872581724",
|
|
||||||
"content": "你是 OpenAI 么?"
|
|
||||||
}
|
|
||||||
|
|
||||||
### 发送消息(流式)
|
|
||||||
POST {{baseUrl}}/ai/chat/message/send-stream
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"conversationId": "1781604279872581724",
|
|
||||||
"content": "1+1=?"
|
|
||||||
}
|
|
||||||
|
|
||||||
### 发送消息(流式)【带文件】
|
|
||||||
POST {{baseUrl}}/ai/chat/message/send-stream
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"conversationId": "1781604279872581797",
|
|
||||||
"content": "图片里有什么?",
|
|
||||||
"attachmentUrls": ["http://test.yudao.iocoder.cn/1755531278.jpeg"]
|
|
||||||
}
|
|
||||||
|
|
||||||
### 发送消息(流式)【追问带文件】
|
|
||||||
POST {{baseUrl}}/ai/chat/message/send-stream
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"conversationId": "1781604279872581799",
|
|
||||||
"content": "说下图片里,有哪些字?",
|
|
||||||
"useContext": true
|
|
||||||
}
|
|
||||||
|
|
||||||
### 发送消息(流式)【联网搜索】
|
|
||||||
POST {{baseUrl}}/ai/chat/message/send-stream
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"conversationId": "1781604279872581799",
|
|
||||||
"content": "今天是周几?",
|
|
||||||
"useSearch": true
|
|
||||||
}
|
|
||||||
|
|
||||||
### 获得指定对话的消息列表
|
|
||||||
GET {{baseUrl}}/ai/chat/message/list-by-conversation-id?conversationId=1781604279872581799
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
### 删除消息
|
|
||||||
DELETE {{baseUrl}}/ai/chat/message/delete?id=50
|
|
||||||
Authorization: {{token}}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message.AiChatMessagePageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message.AiChatMessageRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message.AiChatMessageSendReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message.AiChatMessageSendRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatMessageDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeDocumentDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeSegmentDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.chat.AiChatConversationService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.chat.AiChatMessageService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeDocumentService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeSegmentService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiChatRoleService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import reactor.core.publisher.Flux;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 聊天消息")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/chat/message")
|
|
||||||
@Slf4j
|
|
||||||
public class AiChatMessageController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiChatMessageService chatMessageService;
|
|
||||||
@Resource
|
|
||||||
private AiChatConversationService chatConversationService;
|
|
||||||
@Resource
|
|
||||||
private AiChatRoleService chatRoleService;
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeSegmentService knowledgeSegmentService;
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeDocumentService knowledgeDocumentService;
|
|
||||||
|
|
||||||
@Operation(summary = "发送消息(段式)", description = "一次性返回,响应较慢")
|
|
||||||
@PostMapping("/send")
|
|
||||||
public CommonResult<AiChatMessageSendRespVO> sendMessage(@Valid @RequestBody AiChatMessageSendReqVO sendReqVO) {
|
|
||||||
return success(chatMessageService.sendMessage(sendReqVO, getLoginUserId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "发送消息(流式)", description = "流式返回,响应较快")
|
|
||||||
@PostMapping(value = "/send-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
||||||
public Flux<CommonResult<AiChatMessageSendRespVO>> sendChatMessageStream(@Valid @RequestBody AiChatMessageSendReqVO sendReqVO) {
|
|
||||||
return chatMessageService.sendChatMessageStream(sendReqVO, getLoginUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "获得指定对话的消息列表")
|
|
||||||
@GetMapping("/list-by-conversation-id")
|
|
||||||
@Parameter(name = "conversationId", required = true, description = "对话编号", example = "1024")
|
|
||||||
public CommonResult<List<AiChatMessageRespVO>> getChatMessageListByConversationId(
|
|
||||||
@RequestParam("conversationId") Long conversationId) {
|
|
||||||
AiChatConversationDO conversation = chatConversationService.getChatConversation(conversationId);
|
|
||||||
if (conversation == null || ObjUtil.notEqual(conversation.getUserId(), getLoginUserId())) {
|
|
||||||
return success(Collections.emptyList());
|
|
||||||
}
|
|
||||||
// 1. 获取消息列表
|
|
||||||
List<AiChatMessageDO> messageList = chatMessageService.getChatMessageListByConversationId(conversationId);
|
|
||||||
if (CollUtil.isEmpty(messageList)) {
|
|
||||||
return success(Collections.emptyList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 拼接数据,主要是知识库段落信息
|
|
||||||
Map<Long, AiKnowledgeSegmentDO> segmentMap = knowledgeSegmentService.getKnowledgeSegmentMap(convertListByFlatMap(messageList,
|
|
||||||
message -> CollUtil.isEmpty(message.getSegmentIds()) ? null : message.getSegmentIds().stream()));
|
|
||||||
Map<Long, AiKnowledgeDocumentDO> documentMap = knowledgeDocumentService.getKnowledgeDocumentMap(
|
|
||||||
convertList(segmentMap.values(), AiKnowledgeSegmentDO::getDocumentId));
|
|
||||||
List<AiChatMessageRespVO> messageVOList = BeanUtils.toBean(messageList, AiChatMessageRespVO.class);
|
|
||||||
for (int i = 0; i < messageList.size(); i++) {
|
|
||||||
AiChatMessageDO message = messageList.get(i);
|
|
||||||
if (CollUtil.isEmpty(message.getSegmentIds())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 设置知识库段落信息
|
|
||||||
messageVOList.get(i).setSegments(convertList(message.getSegmentIds(), segmentId -> {
|
|
||||||
AiKnowledgeSegmentDO segment = segmentMap.get(segmentId);
|
|
||||||
if (segment == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
AiKnowledgeDocumentDO document = documentMap.get(segment.getDocumentId());
|
|
||||||
if (document == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new AiChatMessageRespVO.KnowledgeSegment().setId(segment.getId()).setContent(segment.getContent())
|
|
||||||
.setDocumentId(segment.getDocumentId()).setDocumentName(document.getName());
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
return success(messageVOList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除消息")
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Parameter(name = "id", required = true, description = "消息编号", example = "1024")
|
|
||||||
public CommonResult<Boolean> deleteChatMessage(@RequestParam("id") Long id) {
|
|
||||||
chatMessageService.deleteChatMessage(id, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除指定对话的消息")
|
|
||||||
@DeleteMapping("/delete-by-conversation-id")
|
|
||||||
@Parameter(name = "conversationId", required = true, description = "对话编号", example = "1024")
|
|
||||||
public CommonResult<Boolean> deleteChatMessageByConversationId(@RequestParam("conversationId") Long conversationId) {
|
|
||||||
chatMessageService.deleteChatMessageByConversationId(conversationId, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 对话管理 ==========
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得消息分页", description = "用于【对话管理】菜单")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-conversation:query')")
|
|
||||||
public CommonResult<PageResult<AiChatMessageRespVO>> getChatMessagePage(AiChatMessagePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiChatMessageDO> pageResult = chatMessageService.getChatMessagePage(pageReqVO);
|
|
||||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
||||||
return success(PageResult.empty());
|
|
||||||
}
|
|
||||||
// 拼接数据
|
|
||||||
Map<Long, AiChatRoleDO> roleMap = chatRoleService.getChatRoleMap(
|
|
||||||
convertSet(pageResult.getList(), AiChatMessageDO::getRoleId));
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiChatMessageRespVO.class,
|
|
||||||
respVO -> MapUtils.findAndThen(roleMap, respVO.getRoleId(),
|
|
||||||
role -> respVO.setRoleName(role.getName()))));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "管理员删除消息")
|
|
||||||
@DeleteMapping("/delete-by-admin")
|
|
||||||
@Parameter(name = "id", required = true, description = "消息编号", example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-message:delete')")
|
|
||||||
public CommonResult<Boolean> deleteChatMessageByAdmin(@RequestParam("id") Long id) {
|
|
||||||
chatMessageService.deleteChatMessageByAdmin(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天对话创建【我的】 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatConversationCreateMyReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "聊天角色编号", example = "666")
|
|
||||||
private Long roleId;
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", example = "1204")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天对话的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatConversationPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "1024")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "对话标题", example = "你好")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiModelDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
|
|
||||||
import com.fhs.core.trans.anno.Trans;
|
|
||||||
import com.fhs.core.trans.constant.TransType;
|
|
||||||
import com.fhs.core.trans.vo.VO;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天对话 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatConversationRespVO implements VO {
|
|
||||||
|
|
||||||
@Schema(description = "对话编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "对话标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "我是一个标题")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "是否置顶", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
|
||||||
private Boolean pinned;
|
|
||||||
|
|
||||||
@Schema(description = "角色编号", example = "1")
|
|
||||||
@Trans(type = TransType.SIMPLE, target = AiChatRoleDO.class, fields = {"name", "avatar"}, refs = {"roleName", "roleAvatar"})
|
|
||||||
private Long roleId;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@Trans(type = TransType.SIMPLE, target = AiModelDO.class, fields = "name", ref = "modelName")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "模型标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "ERNIE-Bot-turbo-0922")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "模型名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
|
||||||
private String modelName;
|
|
||||||
|
|
||||||
@Schema(description = "角色设定", example = "一个快乐的程序员")
|
|
||||||
private String systemMessage;
|
|
||||||
|
|
||||||
@Schema(description = "温度参数", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.8")
|
|
||||||
private Double temperature;
|
|
||||||
|
|
||||||
@Schema(description = "单条回复的最大 Token 数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
|
|
||||||
private Integer maxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "上下文的最大 Message 数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Integer maxContexts;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
// ========== 关联 role 信息 ==========
|
|
||||||
|
|
||||||
@Schema(description = "角色头像", example = "https://www.iocoder.cn/1.png")
|
|
||||||
private String roleAvatar;
|
|
||||||
|
|
||||||
@Schema(description = "角色名字", example = "小黄")
|
|
||||||
private String roleName;
|
|
||||||
|
|
||||||
// ========== 仅在【对话管理】时加载 ==========
|
|
||||||
|
|
||||||
@Schema(description = "消息数量", example = "20")
|
|
||||||
private Integer messageCount;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天对话更新【我的】 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatConversationUpdateMyReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "对话编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
@NotNull(message = "对话编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "对话标题", example = "我是一个标题")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "是否置顶", example = "true")
|
|
||||||
private Boolean pinned;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", example = "1")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", example = "1")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "角色设定", example = "一个快乐的程序员")
|
|
||||||
private String systemMessage;
|
|
||||||
|
|
||||||
@Schema(description = "温度参数", example = "0.8")
|
|
||||||
private Double temperature;
|
|
||||||
|
|
||||||
@Schema(description = "单条回复的最大 Token 数量", example = "4096")
|
|
||||||
private Integer maxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "上下文的最大 Message 数量", example = "10")
|
|
||||||
private Integer maxContexts;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天消息的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatMessagePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "对话编号", example = "2048")
|
|
||||||
private Long conversationId;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "1024")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "消息内容", example = "你好")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.AiWebSearchResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天消息 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatMessageRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "对话编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
|
||||||
private Long conversationId;
|
|
||||||
|
|
||||||
@Schema(description = "回复消息编号", example = "1024")
|
|
||||||
private Long replyId;
|
|
||||||
|
|
||||||
@Schema(description = "消息类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "role")
|
|
||||||
private String type; // 参见 MessageType 枚举类
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "4096")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "角色编号", example = "888")
|
|
||||||
private Long roleId;
|
|
||||||
|
|
||||||
@Schema(description = "模型标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "gpt-3.5-turbo")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "聊天内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "你好,你好啊")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "推理内容", example = "要达到这个目标,你需要...")
|
|
||||||
private String reasoningContent;
|
|
||||||
|
|
||||||
@Schema(description = "是否携带上下文", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
|
||||||
private Boolean useContext;
|
|
||||||
|
|
||||||
@Schema(description = "知识库段落编号数组", example = "[1,2,3]")
|
|
||||||
private List<Long> segmentIds;
|
|
||||||
|
|
||||||
@Schema(description = "知识库段落数组")
|
|
||||||
private List<KnowledgeSegment> segments;
|
|
||||||
|
|
||||||
@Schema(description = "联网搜索的网页内容数组")
|
|
||||||
private List<AiWebSearchResponse.WebPage> webSearchPages;
|
|
||||||
|
|
||||||
@Schema(description = "附件 URL 数组", example = "https://www.iocoder.cn/1.png")
|
|
||||||
private List<String> attachmentUrls;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-05-12 12:51")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
// ========== 仅在【对话管理】时加载 ==========
|
|
||||||
|
|
||||||
@Schema(description = "角色名字", example = "小黄")
|
|
||||||
private String roleName;
|
|
||||||
|
|
||||||
@Schema(description = "知识库段落", example = "Java 开发手册")
|
|
||||||
@Data
|
|
||||||
public static class KnowledgeSegment {
|
|
||||||
|
|
||||||
@Schema(description = "段落编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "切片内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 开发手册")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "文档编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long documentId;
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "产品使用手册")
|
|
||||||
private String documentName;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天消息发送 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatMessageSendReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "聊天对话编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
@NotNull(message = "聊天对话编号不能为空")
|
|
||||||
private Long conversationId;
|
|
||||||
|
|
||||||
@Schema(description = "聊天内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "帮我写个 Java 算法")
|
|
||||||
@NotEmpty(message = "聊天内容不能为空")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "是否携带上下文", example = "true")
|
|
||||||
private Boolean useContext;
|
|
||||||
|
|
||||||
@Schema(description = "是否联网搜索", example = "true")
|
|
||||||
private Boolean useSearch;
|
|
||||||
|
|
||||||
@Schema(description = "附件 URL 数组", example = "https://www.iocoder.cn/1.png")
|
|
||||||
private List<String> attachmentUrls;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.chat.vo.message;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.AiWebSearchResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天消息发送 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatMessageSendRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "发送消息", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Message send;
|
|
||||||
|
|
||||||
@Schema(description = "接收消息", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Message receive;
|
|
||||||
|
|
||||||
@Schema(description = "消息")
|
|
||||||
@Data
|
|
||||||
public static class Message {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "消息类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "role")
|
|
||||||
private String type; // 参见 MessageType 枚举类
|
|
||||||
|
|
||||||
@Schema(description = "聊天内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "你好,你好啊")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "推理内容", example = "要达到这个目标,你需要...")
|
|
||||||
private String reasoningContent;
|
|
||||||
|
|
||||||
@Schema(description = "知识库段落编号数组", example = "[1,2,3]")
|
|
||||||
private List<Long> segmentIds;
|
|
||||||
|
|
||||||
@Schema(description = "知识库段落数组")
|
|
||||||
private List<AiChatMessageRespVO.KnowledgeSegment> segments;
|
|
||||||
|
|
||||||
@Schema(description = "联网搜索的网页内容数组")
|
|
||||||
private List<AiWebSearchResponse.WebPage> webSearchPages;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
### 生成图片:OpenAI(DALL)
|
|
||||||
POST {{baseUrl}}/ai/image/draw
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"platform": "OpenAI",
|
|
||||||
"prompt": "可爱的小喵星人",
|
|
||||||
"model": "dall-e-3",
|
|
||||||
"height": "1024",
|
|
||||||
"width": "1024",
|
|
||||||
"options": {
|
|
||||||
"style": "vivid"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
### 生成图片:StableDiffusion
|
|
||||||
POST {{baseUrl}}/ai/image/draw
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"platform": "StableDiffusion",
|
|
||||||
"prompt": "中国长城",
|
|
||||||
"model": "stable-diffusion-v1-6",
|
|
||||||
"height": "1024",
|
|
||||||
"width": "1024",
|
|
||||||
"style": "vivid"
|
|
||||||
}
|
|
||||||
|
|
||||||
### 生成图片:生成图片(Midjourney)
|
|
||||||
POST {{baseUrl}}/ai/image/midjourney/imagine
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"prompt": "中国旗袍",
|
|
||||||
"model": "midjourney",
|
|
||||||
"width": "1",
|
|
||||||
"height": "1",
|
|
||||||
"version": "6.0"
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.iocoder.yudao.module.ai.framework.ai.core.model.midjourney.api.MidjourneyApi;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyActionReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyImagineReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.image.AiImageDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.image.AiImageService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.annotation.security.PermitAll;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 绘画")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/image")
|
|
||||||
@Slf4j
|
|
||||||
public class AiImageController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiImageService imageService;
|
|
||||||
|
|
||||||
@GetMapping("/my-page")
|
|
||||||
@Operation(summary = "获取【我的】绘图分页")
|
|
||||||
public CommonResult<PageResult<AiImageRespVO>> getImagePageMy(@Validated AiImagePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiImageDO> pageResult = imageService.getImagePageMy(getLoginUserId(), pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiImageRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/public-page")
|
|
||||||
@Operation(summary = "获取公开的绘图分页")
|
|
||||||
public CommonResult<PageResult<AiImageRespVO>> getImagePagePublic(AiImagePublicPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiImageDO> pageResult = imageService.getImagePagePublic(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiImageRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-my")
|
|
||||||
@Operation(summary = "获取【我的】绘图记录")
|
|
||||||
@Parameter(name = "id", required = true, description = "绘画编号", example = "1024")
|
|
||||||
public CommonResult<AiImageRespVO> getImageMy(@RequestParam("id") Long id) {
|
|
||||||
AiImageDO image = imageService.getImage(id);
|
|
||||||
if (image == null || ObjUtil.notEqual(getLoginUserId(), image.getUserId())) {
|
|
||||||
return success(null);
|
|
||||||
}
|
|
||||||
return success(BeanUtils.toBean(image, AiImageRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/my-list-by-ids")
|
|
||||||
@Operation(summary = "获取【我的】绘图记录列表")
|
|
||||||
@Parameter(name = "ids", required = true, description = "绘画编号数组", example = "1024,2048")
|
|
||||||
public CommonResult<List<AiImageRespVO>> getImageListMyByIds(@RequestParam("ids") List<Long> ids) {
|
|
||||||
List<AiImageDO> imageList = imageService.getImageList(ids);
|
|
||||||
imageList.removeIf(item -> !ObjUtil.equal(getLoginUserId(), item.getUserId()));
|
|
||||||
return success(BeanUtils.toBean(imageList, AiImageRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "生成图片")
|
|
||||||
@PostMapping("/draw")
|
|
||||||
public CommonResult<Long> drawImage(@Valid @RequestBody AiImageDrawReqVO drawReqVO) {
|
|
||||||
return success(imageService.drawImage(getLoginUserId(), drawReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除【我的】绘画记录")
|
|
||||||
@DeleteMapping("/delete-my")
|
|
||||||
@Parameter(name = "id", required = true, description = "绘画编号", example = "1024")
|
|
||||||
public CommonResult<Boolean> deleteImageMy(@RequestParam("id") Long id) {
|
|
||||||
imageService.deleteImageMy(id, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================ midjourney 专属 ================
|
|
||||||
|
|
||||||
@Operation(summary = "【Midjourney】生成图片")
|
|
||||||
@PostMapping("/midjourney/imagine")
|
|
||||||
public CommonResult<Long> midjourneyImagine(@Valid @RequestBody AiMidjourneyImagineReqVO reqVO) {
|
|
||||||
Long imageId = imageService.midjourneyImagine(getLoginUserId(), reqVO);
|
|
||||||
return success(imageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "【Midjourney】通知图片进展", description = "由 Midjourney Proxy 回调")
|
|
||||||
@PostMapping("/midjourney/notify") // 必须是 POST 方法,否则会报错
|
|
||||||
@PermitAll
|
|
||||||
@TenantIgnore
|
|
||||||
public CommonResult<Boolean> midjourneyNotify(@Valid @RequestBody MidjourneyApi.Notify notify) {
|
|
||||||
imageService.midjourneyNotify(notify);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "【Midjourney】Action 操作(二次生成图片)", description = "例如说:放大、缩小、U1、U2 等")
|
|
||||||
@PostMapping("/midjourney/action")
|
|
||||||
public CommonResult<Long> midjourneyAction(@Valid @RequestBody AiMidjourneyActionReqVO reqVO) {
|
|
||||||
Long imageId = imageService.midjourneyAction(getLoginUserId(), reqVO);
|
|
||||||
return success(imageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================ 绘图管理 ================
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得绘画分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:image:query')")
|
|
||||||
public CommonResult<PageResult<AiImageRespVO>> getImagePage(@Valid AiImagePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiImageDO> pageResult = imageService.getImagePage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiImageRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新绘画")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:image:update')")
|
|
||||||
public CommonResult<Boolean> updateImage(@Valid @RequestBody AiImageUpdateReqVO updateReqVO) {
|
|
||||||
imageService.updateImage(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除绘画")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:image:delete')")
|
|
||||||
public CommonResult<Boolean> deleteImage(@RequestParam("id") Long id) {
|
|
||||||
imageService.deleteImage(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import jakarta.validation.constraints.Size;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.ai.openai.OpenAiImageOptions;
|
|
||||||
import org.springframework.ai.stabilityai.api.StabilityAiImageOptions;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiImageDrawReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
@NotNull(message = "模型编号不能为空")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "提示词", requiredMode = Schema.RequiredMode.REQUIRED, example = "画一个长城")
|
|
||||||
@NotEmpty(message = "提示词不能为空")
|
|
||||||
@Size(max = 1200, message = "提示词最大 1200")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. dall-e-2 模型:256x256、512x512、1024x1024
|
|
||||||
* 2. dall-e-3 模型:1024x1024, 1792x1024, 或 1024x1792
|
|
||||||
*/
|
|
||||||
@Schema(description = "图片高度")
|
|
||||||
@NotNull(message = "图片高度不能为空")
|
|
||||||
private Integer height;
|
|
||||||
|
|
||||||
@Schema(description = "图片宽度")
|
|
||||||
@NotNull(message = "图片宽度不能为空")
|
|
||||||
private Integer width;
|
|
||||||
|
|
||||||
// ========== 各平台绘画的拓展参数 ==========
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绘制参数,不同 platform 的不同参数
|
|
||||||
*
|
|
||||||
* 1. {@link OpenAiImageOptions}
|
|
||||||
* 2. {@link StabilityAiImageOptions}
|
|
||||||
*/
|
|
||||||
@Schema(description = "绘制参数")
|
|
||||||
private Map<String, String> options;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiImagePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "28987")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "平台", example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "提示词", example = "1")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "绘画状态", example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", example = "1")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画公开的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiImagePublicPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "提示词")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.framework.ai.core.model.midjourney.api.MidjourneyApi;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiImageRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "OpenAI")
|
|
||||||
private String platform; // 参见 AiPlatformEnum 枚举
|
|
||||||
|
|
||||||
@Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "stable-diffusion-v1-6")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "提示词", requiredMode = Schema.RequiredMode.REQUIRED, example = "南极的小企鹅")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "图片宽度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer width;
|
|
||||||
|
|
||||||
@Schema(description = "图片高度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer height;
|
|
||||||
|
|
||||||
@Schema(description = "绘画状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", requiredMode = Schema.RequiredMode.REQUIRED, example = "public")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "图片地址", example = "https://www.iocoder.cn/1.png")
|
|
||||||
private String picUrl;
|
|
||||||
|
|
||||||
@Schema(description = "绘画错误信息", example = "图片错误信息")
|
|
||||||
private String errorMessage;
|
|
||||||
|
|
||||||
@Schema(description = "绘制参数")
|
|
||||||
private Map<String, String> options;
|
|
||||||
|
|
||||||
@Schema(description = "mj buttons 按钮")
|
|
||||||
private List<MidjourneyApi.Button> buttons;
|
|
||||||
|
|
||||||
@Schema(description = "完成时间")
|
|
||||||
private LocalDateTime finishTime;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiImageUpdateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15583")
|
|
||||||
@NotNull(message = "编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", example = "true")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘图操作(Midjourney) Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMidjourneyActionReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "图片编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "图片编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "操作按钮编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "MJ::JOB::variation::4::06aa3e66-0e97-49cc-8201-e0295d883de4")
|
|
||||||
@NotEmpty(message = "操作按钮编号不能为空")
|
|
||||||
private String customId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 绘画生成(Midjourney) Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMidjourneyImagineReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "提示词", requiredMode = Schema.RequiredMode.REQUIRED, example = "中国神龙")
|
|
||||||
@NotEmpty(message = "提示词不能为空!")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "模型编号不能为空")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "图片宽度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "图片宽度不能为空")
|
|
||||||
private Integer width;
|
|
||||||
|
|
||||||
@Schema(description = "图片高度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "图片高度不能为空")
|
|
||||||
private Integer height;
|
|
||||||
|
|
||||||
@Schema(description = "版本号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6.0")
|
|
||||||
@NotEmpty(message = "版本号不能为空")
|
|
||||||
private String version;
|
|
||||||
|
|
||||||
@Schema(description = "参考图", example = "https://www.iocoder.cn/x.png")
|
|
||||||
private String referImageUrl;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
### 创建知识库
|
|
||||||
POST {{baseUrl}}/ai/knowledge/create
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "测试标题",
|
|
||||||
"description": "测试描述",
|
|
||||||
"embeddingModelId": 30,
|
|
||||||
"topK": 3,
|
|
||||||
"similarityThreshold": 0.5,
|
|
||||||
"status": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
### 更新知识库
|
|
||||||
PUT {{baseUrl}}/ai/knowledge/update
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "测试标题(更新)",
|
|
||||||
"description": "测试描述",
|
|
||||||
"embeddingModelId": 30,
|
|
||||||
"topK": 5,
|
|
||||||
"similarityThreshold": 0.6,
|
|
||||||
"status": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
### 获取知识库分页
|
|
||||||
GET {{baseUrl}}/ai/knowledge/page?pageNo=1&pageSize=10
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge.AiKnowledgePageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge.AiKnowledgeRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge.AiKnowledgeSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 知识库")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/knowledge")
|
|
||||||
@Validated
|
|
||||||
public class AiKnowledgeController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeService knowledgeService;
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获取知识库分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<PageResult<AiKnowledgeRespVO>> getKnowledgePage(@Valid AiKnowledgePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiKnowledgeDO> pageResult = knowledgeService.getKnowledgePage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiKnowledgeRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得知识库")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<AiKnowledgeRespVO> getKnowledge(@RequestParam("id") Long id) {
|
|
||||||
AiKnowledgeDO knowledge = knowledgeService.getKnowledge(id);
|
|
||||||
return success(BeanUtils.toBean(knowledge, AiKnowledgeRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建知识库")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:create')")
|
|
||||||
public CommonResult<Long> createKnowledge(@RequestBody @Valid AiKnowledgeSaveReqVO createReqVO) {
|
|
||||||
return success(knowledgeService.createKnowledge(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新知识库")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
|
|
||||||
public CommonResult<Boolean> updateKnowledge(@RequestBody @Valid AiKnowledgeSaveReqVO updateReqVO) {
|
|
||||||
knowledgeService.updateKnowledge(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除知识库")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:delete')")
|
|
||||||
public CommonResult<Boolean> deleteKnowledge(@RequestParam("id") Long id) {
|
|
||||||
knowledgeService.deleteKnowledge(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/simple-list")
|
|
||||||
@Operation(summary = "获得知识库的精简列表")
|
|
||||||
public CommonResult<List<AiKnowledgeRespVO>> getKnowledgeSimpleList() {
|
|
||||||
List<AiKnowledgeDO> list = knowledgeService.getKnowledgeSimpleListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
|
||||||
return success(convertList(list, knowledge -> new AiKnowledgeRespVO()
|
|
||||||
.setId(knowledge.getId()).setName(knowledge.getName())));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
### 创建知识文档
|
|
||||||
POST {{baseUrl}}/ai/knowledge/document/create
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"knowledgeId": 2,
|
|
||||||
"name": "测试文档",
|
|
||||||
"url": "https://static.iocoder.cn/README.md",
|
|
||||||
"segmentMaxTokens": 800
|
|
||||||
}
|
|
||||||
|
|
||||||
### 批量创建知识文档
|
|
||||||
POST {{baseUrl}}/ai/knowledge/document/create-list
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"knowledgeId": 1,
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"name": "测试文档1",
|
|
||||||
"url": "https://static.iocoder.cn/README.md",
|
|
||||||
"segmentMaxTokens": 800
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "测试文档2",
|
|
||||||
"url": "https://static.iocoder.cn/README_yudao.md",
|
|
||||||
"segmentMaxTokens": 400
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document.*;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge.AiKnowledgeDocumentCreateReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeDocumentDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeDocumentService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 知识库文档")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/knowledge/document")
|
|
||||||
@Validated
|
|
||||||
public class AiKnowledgeDocumentController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeDocumentService documentService;
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获取文档分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<PageResult<AiKnowledgeDocumentRespVO>> getKnowledgeDocumentPage(
|
|
||||||
@Valid AiKnowledgeDocumentPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiKnowledgeDocumentDO> pageResult = documentService.getKnowledgeDocumentPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiKnowledgeDocumentRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获取文档详情")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<AiKnowledgeDocumentRespVO> getKnowledgeDocument(@RequestParam("id") Long id) {
|
|
||||||
AiKnowledgeDocumentDO document = documentService.getKnowledgeDocument(id);
|
|
||||||
return success(BeanUtils.toBean(document, AiKnowledgeDocumentRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "新建文档(单个)")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:create')")
|
|
||||||
public CommonResult<Long> createKnowledgeDocument(@RequestBody @Valid AiKnowledgeDocumentCreateReqVO reqVO) {
|
|
||||||
Long id = documentService.createKnowledgeDocument(reqVO);
|
|
||||||
return success(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create-list")
|
|
||||||
@Operation(summary = "新建文档(多个)")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:create')")
|
|
||||||
public CommonResult<List<Long>> createKnowledgeDocumentList(
|
|
||||||
@RequestBody @Valid AiKnowledgeDocumentCreateListReqVO reqVO) {
|
|
||||||
List<Long> ids = documentService.createKnowledgeDocumentList(reqVO);
|
|
||||||
return success(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新文档")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
|
|
||||||
public CommonResult<Boolean> updateKnowledgeDocument(@Valid @RequestBody AiKnowledgeDocumentUpdateReqVO reqVO) {
|
|
||||||
documentService.updateKnowledgeDocument(reqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update-status")
|
|
||||||
@Operation(summary = "更新文档状态")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
|
|
||||||
public CommonResult<Boolean> updateKnowledgeDocumentStatus(
|
|
||||||
@Valid @RequestBody AiKnowledgeDocumentUpdateStatusReqVO reqVO) {
|
|
||||||
documentService.updateKnowledgeDocumentStatus(reqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除文档")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:delete')")
|
|
||||||
public CommonResult<Boolean> deleteKnowledgeDocument(@RequestParam("id") Long id) {
|
|
||||||
documentService.deleteKnowledgeDocument(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
### 切片内容
|
|
||||||
GET {{baseUrl}}/ai/knowledge/segment/split?url=https://static.iocoder.cn/README_yudao.md&segmentMaxTokens=800
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
### 搜索段落内容
|
|
||||||
GET {{baseUrl}}/ai/knowledge/segment/search?knowledgeId=2&content=如何使用这个产品&topK=5&similarityThreshold=0.1
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
### 获取文档处理列表
|
|
||||||
GET {{baseUrl}}/ai/knowledge/segment/get-process-list?documentIds=1,2,3
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.*;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeDocumentDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeSegmentDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeDocumentService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.AiKnowledgeSegmentService;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.bo.AiKnowledgeSegmentSearchReqBO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.knowledge.bo.AiKnowledgeSegmentSearchRespBO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameters;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.hibernate.validator.constraints.URL;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 知识库段落")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/knowledge/segment")
|
|
||||||
@Validated
|
|
||||||
public class AiKnowledgeSegmentController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeSegmentService segmentService;
|
|
||||||
@Resource
|
|
||||||
private AiKnowledgeDocumentService documentService;
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获取段落详情")
|
|
||||||
@Parameter(name = "id", description = "段落编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<AiKnowledgeSegmentRespVO> getKnowledgeSegment(@RequestParam("id") Long id) {
|
|
||||||
AiKnowledgeSegmentDO segment = segmentService.getKnowledgeSegment(id);
|
|
||||||
return success(BeanUtils.toBean(segment, AiKnowledgeSegmentRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获取段落分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<PageResult<AiKnowledgeSegmentRespVO>> getKnowledgeSegmentPage(
|
|
||||||
@Valid AiKnowledgeSegmentPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiKnowledgeSegmentDO> pageResult = segmentService.getKnowledgeSegmentPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiKnowledgeSegmentRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建段落")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:create')")
|
|
||||||
public CommonResult<Long> createKnowledgeSegment(@Valid @RequestBody AiKnowledgeSegmentSaveReqVO createReqVO) {
|
|
||||||
return success(segmentService.createKnowledgeSegment(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新段落内容")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
|
|
||||||
public CommonResult<Boolean> updateKnowledgeSegment(@Valid @RequestBody AiKnowledgeSegmentSaveReqVO reqVO) {
|
|
||||||
segmentService.updateKnowledgeSegment(reqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update-status")
|
|
||||||
@Operation(summary = "启禁用段落内容")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
|
|
||||||
public CommonResult<Boolean> updateKnowledgeSegmentStatus(
|
|
||||||
@Valid @RequestBody AiKnowledgeSegmentUpdateStatusReqVO reqVO) {
|
|
||||||
segmentService.updateKnowledgeSegmentStatus(reqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/split")
|
|
||||||
@Operation(summary = "切片内容")
|
|
||||||
@Parameters({
|
|
||||||
@Parameter(name = "url", description = "文档 URL", required = true),
|
|
||||||
@Parameter(name = "segmentMaxTokens", description = "分段的最大 Token 数", required = true)
|
|
||||||
})
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<List<AiKnowledgeSegmentRespVO>> splitContent(
|
|
||||||
@RequestParam("url") @URL String url,
|
|
||||||
@RequestParam(value = "segmentMaxTokens") Integer segmentMaxTokens) {
|
|
||||||
List<AiKnowledgeSegmentDO> segments = segmentService.splitContent(url, segmentMaxTokens);
|
|
||||||
return success(BeanUtils.toBean(segments, AiKnowledgeSegmentRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-process-list")
|
|
||||||
@Operation(summary = "获取文档处理列表")
|
|
||||||
@Parameter(name = "documentIds", description = "文档编号列表", required = true, example = "1,2,3")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<List<AiKnowledgeSegmentProcessRespVO>> getKnowledgeSegmentProcessList(
|
|
||||||
@RequestParam("documentIds") List<Long> documentIds) {
|
|
||||||
List<AiKnowledgeSegmentProcessRespVO> list = segmentService.getKnowledgeSegmentProcessList(documentIds);
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/search")
|
|
||||||
@Operation(summary = "搜索段落内容")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:knowledge:query')")
|
|
||||||
public CommonResult<List<AiKnowledgeSegmentSearchRespVO>> searchKnowledgeSegment(
|
|
||||||
@Valid AiKnowledgeSegmentSearchReqVO reqVO) {
|
|
||||||
// 1. 搜索段落
|
|
||||||
List<AiKnowledgeSegmentSearchRespBO> segments = segmentService
|
|
||||||
.searchKnowledgeSegment(BeanUtils.toBean(reqVO, AiKnowledgeSegmentSearchReqBO.class));
|
|
||||||
if (CollUtil.isEmpty(segments)) {
|
|
||||||
return success(Collections.emptyList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 拼接 VO
|
|
||||||
Map<Long, AiKnowledgeDocumentDO> documentMap = documentService.getKnowledgeDocumentMap(convertSet(
|
|
||||||
segments, AiKnowledgeSegmentSearchRespBO::getDocumentId));
|
|
||||||
return success(BeanUtils.toBean(segments, AiKnowledgeSegmentSearchRespVO.class,
|
|
||||||
segment -> MapUtils.findAndThen(documentMap, segment.getDocumentId(),
|
|
||||||
document -> segment.setDocumentName(document.getName()))));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.hibernate.validator.constraints.URL;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档批量创建 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentCreateListReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1204")
|
|
||||||
@NotNull(message = "知识库编号不能为空")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "分段的最大 Token 数", requiredMode = Schema.RequiredMode.REQUIRED, example = "800")
|
|
||||||
@NotNull(message = "分段的最大 Token 数不能为空")
|
|
||||||
private Integer segmentMaxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "文档列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotEmpty(message = "文档列表不能为空")
|
|
||||||
private List<Document> list;
|
|
||||||
|
|
||||||
@Schema(description = "文档")
|
|
||||||
@Data
|
|
||||||
public static class Document {
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "三方登陆")
|
|
||||||
@NotBlank(message = "文档名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn")
|
|
||||||
@URL(message = "文档 URL 格式不正确")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", example = "1")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", example = "Java 开发手册")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "文档编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 开发手册")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Schema(description = "文档内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 是一门面向对象的语言.....")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "文档内容长度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
|
||||||
private Integer contentLength;
|
|
||||||
|
|
||||||
@Schema(description = "文档 Token 数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer tokens;
|
|
||||||
|
|
||||||
@Schema(description = "分片最大 Token 数", requiredMode = Schema.RequiredMode.REQUIRED, example = "512")
|
|
||||||
private Integer segmentMaxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "召回次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Integer retrievalCount;
|
|
||||||
|
|
||||||
@Schema(description = "文档状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档更新 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentUpdateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15583")
|
|
||||||
@NotNull(message = "编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称", example = "Java 开发手册")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "分片最大 Token 数", example = "1000")
|
|
||||||
private Integer segmentMaxTokens;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.document;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档更新状态 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentUpdateStatusReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15583")
|
|
||||||
@NotNull(message = "编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.hibernate.validator.constraints.URL;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档的创建 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeDocumentCreateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1204")
|
|
||||||
@NotNull(message = "知识库编号不能为空")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "三方登陆")
|
|
||||||
@NotBlank(message = "文档名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn")
|
|
||||||
@URL(message = "文档 URL 格式不正确")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Schema(description = "分段的最大 Token 数", requiredMode = Schema.RequiredMode.REQUIRED, example = "800")
|
|
||||||
@NotNull(message = "分段的最大 Token 数不能为空")
|
|
||||||
private Integer segmentMaxTokens;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge;
|
|
||||||
|
|
||||||
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.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "知识库名称", example = "芋艿")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "是否启用", example = "1")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "知识库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ruoyi-vue-pro 用户指南")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "知识库描述", example = "帮助你快速构建系统")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "向量模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14")
|
|
||||||
private Long embeddingModelId;
|
|
||||||
|
|
||||||
@Schema(description = "向量模型标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "qwen-72b-chat")
|
|
||||||
private String embeddingModel;
|
|
||||||
|
|
||||||
@Schema(description = "topK", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
|
||||||
private Integer topK;
|
|
||||||
|
|
||||||
@Schema(description = "相似度阈值", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.7")
|
|
||||||
private Double similarityThreshold;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.knowledge;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "对话编号", example = "1204")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "知识库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ruoyi-vue-pro 用户指南")
|
|
||||||
@NotBlank(message = "知识库名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "知识库描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "存储 ruoyi-vue-pro 操作文档")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "向量模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "向量模型不能为空")
|
|
||||||
private Long embeddingModelId;
|
|
||||||
|
|
||||||
@Schema(description = "topK", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
|
||||||
@NotNull(message = "topK 不能为空")
|
|
||||||
private Integer topK;
|
|
||||||
|
|
||||||
@Schema(description = "相似性阈值", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.5")
|
|
||||||
@NotNull(message = "相似性阈值不能为空")
|
|
||||||
private Double similarityThreshold;
|
|
||||||
|
|
||||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "是否启用不能为空")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
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.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库分段的分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "文档编号", example = "1")
|
|
||||||
private Long documentId;
|
|
||||||
|
|
||||||
@Schema(description = "分段内容关键字", example = "Java 开发")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "分段状态", example = "1")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库段落向量进度 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentProcessRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "文档编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Long documentId;
|
|
||||||
|
|
||||||
@Schema(description = "总段落数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Long count;
|
|
||||||
|
|
||||||
@Schema(description = "已向量化段落数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
|
|
||||||
private Long embeddingCount;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库文档分片 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "文档编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long documentId;
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "向量库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1858496a-1dde-4edf-a43e-0aed08f37f8c")
|
|
||||||
private String vectorId;
|
|
||||||
|
|
||||||
@Schema(description = "切片内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 开发手册")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "切片内容长度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer contentLength;
|
|
||||||
|
|
||||||
@Schema(description = "token 数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer tokens;
|
|
||||||
|
|
||||||
@Schema(description = "召回次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Integer retrievalCount;
|
|
||||||
|
|
||||||
@Schema(description = "文档状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Long createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 新增/修改知识库段落 request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "知识库文档编号", example = "1024")
|
|
||||||
private Long documentId;
|
|
||||||
|
|
||||||
@Schema(description = "切片内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 开发手册")
|
|
||||||
@NotEmpty(message = "切片内容不能为空")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库段落搜索 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentSearchReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "知识库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
@NotNull(message = "知识库编号不能为空")
|
|
||||||
private Long knowledgeId;
|
|
||||||
|
|
||||||
@Schema(description = "内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "如何使用这个产品")
|
|
||||||
@NotEmpty(message = "内容不能为空")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
@Schema(description = "最大返回数量", example = "5")
|
|
||||||
private Integer topK;
|
|
||||||
|
|
||||||
@Schema(description = "相似度阈值", example = "0.7")
|
|
||||||
private Double similarityThreshold;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库段落搜索 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentSearchRespVO extends AiKnowledgeSegmentRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "产品使用手册")
|
|
||||||
private String documentName;
|
|
||||||
|
|
||||||
@Schema(description = "相似度分数", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.95")
|
|
||||||
private Double score;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 知识库段落的更新状态 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiKnowledgeSegmentUpdateStatusReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "是否启用不能为空")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.mindmap;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo.AiMindMapGenerateReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo.AiMindMapPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo.AiMindMapRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.mindmap.AiMindMapDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.mindmap.AiMindMapService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import reactor.core.publisher.Flux;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 思维导图")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/mind-map")
|
|
||||||
public class AiMindMapController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiMindMapService mindMapService;
|
|
||||||
|
|
||||||
@PostMapping(value = "/generate-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
||||||
@Operation(summary = "导图生成(流式)", description = "流式返回,响应较快")
|
|
||||||
public Flux<CommonResult<String>> generateMindMap(@RequestBody @Valid AiMindMapGenerateReqVO generateReqVO) {
|
|
||||||
return mindMapService.generateMindMap(generateReqVO, getLoginUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================ 导图管理 ================
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除思维导图")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:mind-map:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMindMap(@RequestParam("id") Long id) {
|
|
||||||
mindMapService.deleteMindMap(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得思维导图分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:mind-map:query')")
|
|
||||||
public CommonResult<PageResult<AiMindMapRespVO>> getMindMapPage(@Valid AiMindMapPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiMindMapDO> pageResult = mindMapService.getMindMapPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiMindMapRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 思维导图生成 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMindMapGenerateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "思维导图内容提示", example = "Java 学习路线")
|
|
||||||
@NotBlank(message = "思维导图内容提示不能为空")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 思维导图分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMindMapPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "4325")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "生成内容提示", example = "Java 学习路线")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.mindmap.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 思维导图 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiMindMapRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3373")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4325")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "生成内容提示", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 学习路线")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "生成的思维导图内容")
|
|
||||||
private String generatedContent;
|
|
||||||
|
|
||||||
@Schema(description = "平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "gpt-3.5-turbo-0125")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "错误信息")
|
|
||||||
private String errorMessage;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey.AiApiKeyPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey.AiApiKeyRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey.AiApiKeySaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiModelRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiApiKeyDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiApiKeyService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI API 密钥")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/api-key")
|
|
||||||
@Validated
|
|
||||||
public class AiApiKeyController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiApiKeyService apiKeyService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建 API 密钥")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:api-key:create')")
|
|
||||||
public CommonResult<Long> createApiKey(@Valid @RequestBody AiApiKeySaveReqVO createReqVO) {
|
|
||||||
return success(apiKeyService.createApiKey(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新 API 密钥")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:api-key:update')")
|
|
||||||
public CommonResult<Boolean> updateApiKey(@Valid @RequestBody AiApiKeySaveReqVO updateReqVO) {
|
|
||||||
apiKeyService.updateApiKey(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除 API 密钥")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:api-key:delete')")
|
|
||||||
public CommonResult<Boolean> deleteApiKey(@RequestParam("id") Long id) {
|
|
||||||
apiKeyService.deleteApiKey(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得 API 密钥")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:api-key:query')")
|
|
||||||
public CommonResult<AiApiKeyRespVO> getApiKey(@RequestParam("id") Long id) {
|
|
||||||
AiApiKeyDO apiKey = apiKeyService.getApiKey(id);
|
|
||||||
return success(BeanUtils.toBean(apiKey, AiApiKeyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得 API 密钥分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:api-key:query')")
|
|
||||||
public CommonResult<PageResult<AiApiKeyRespVO>> getApiKeyPage(@Valid AiApiKeyPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiApiKeyDO> pageResult = apiKeyService.getApiKeyPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiApiKeyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/simple-list")
|
|
||||||
@Operation(summary = "获得 API 密钥分页列表")
|
|
||||||
public CommonResult<List<AiModelRespVO>> getApiKeySimpleList() {
|
|
||||||
List<AiApiKeyDO> list = apiKeyService.getApiKeyList();
|
|
||||||
return success(convertList(list, key -> new AiModelRespVO().setId(key.getId()).setName(key.getName())));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRolePageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleSaveMyReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiChatRoleService;
|
|
||||||
import com.fhs.core.trans.anno.TransMethodResult;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 聊天角色")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/chat-role")
|
|
||||||
@Validated
|
|
||||||
public class AiChatRoleController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiChatRoleService chatRoleService;
|
|
||||||
|
|
||||||
@GetMapping("/my-page")
|
|
||||||
@Operation(summary = "获得【我的】聊天角色分页")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<PageResult<AiChatRoleRespVO>> getChatRoleMyPage(@Valid AiChatRolePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiChatRoleDO> pageResult = chatRoleService.getChatRoleMyPage(pageReqVO, getLoginUserId());
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiChatRoleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-my")
|
|
||||||
@Operation(summary = "获得【我的】聊天角色")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<AiChatRoleRespVO> getChatRoleMy(@RequestParam("id") Long id) {
|
|
||||||
AiChatRoleDO chatRole = chatRoleService.getChatRole(id);
|
|
||||||
if (ObjUtil.notEqual(chatRole.getUserId(), getLoginUserId())) {
|
|
||||||
return success(null);
|
|
||||||
}
|
|
||||||
return success(BeanUtils.toBean(chatRole, AiChatRoleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create-my")
|
|
||||||
@Operation(summary = "创建【我的】聊天角色")
|
|
||||||
public CommonResult<Long> createChatRoleMy(@Valid @RequestBody AiChatRoleSaveMyReqVO createReqVO) {
|
|
||||||
return success(chatRoleService.createChatRoleMy(createReqVO, getLoginUserId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update-my")
|
|
||||||
@Operation(summary = "更新【我的】聊天角色")
|
|
||||||
public CommonResult<Boolean> updateChatRoleMy(@Valid @RequestBody AiChatRoleSaveMyReqVO updateReqVO) {
|
|
||||||
chatRoleService.updateChatRoleMy(updateReqVO, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-my")
|
|
||||||
@Operation(summary = "删除【我的】聊天角色")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
public CommonResult<Boolean> deleteChatRoleMy(@RequestParam("id") Long id) {
|
|
||||||
chatRoleService.deleteChatRoleMy(id, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/category-list")
|
|
||||||
@Operation(summary = "获得聊天角色的分类列表")
|
|
||||||
public CommonResult<List<String>> getChatRoleCategoryList() {
|
|
||||||
return success(chatRoleService.getChatRoleCategoryList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 角色管理 ==========
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建聊天角色")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-role:create')")
|
|
||||||
public CommonResult<Long> createChatRole(@Valid @RequestBody AiChatRoleSaveReqVO createReqVO) {
|
|
||||||
return success(chatRoleService.createChatRole(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新聊天角色")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-role:update')")
|
|
||||||
public CommonResult<Boolean> updateChatRole(@Valid @RequestBody AiChatRoleSaveReqVO updateReqVO) {
|
|
||||||
chatRoleService.updateChatRole(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除聊天角色")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-role:delete')")
|
|
||||||
public CommonResult<Boolean> deleteChatRole(@RequestParam("id") Long id) {
|
|
||||||
chatRoleService.deleteChatRole(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得聊天角色")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-role:query')")
|
|
||||||
@TransMethodResult
|
|
||||||
public CommonResult<AiChatRoleRespVO> getChatRole(@RequestParam("id") Long id) {
|
|
||||||
AiChatRoleDO chatRole = chatRoleService.getChatRole(id);
|
|
||||||
return success(BeanUtils.toBean(chatRole, AiChatRoleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得聊天角色分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:chat-role:query')")
|
|
||||||
public CommonResult<PageResult<AiChatRoleRespVO>> getChatRolePage(@Valid AiChatRolePageReqVO pageReqVO) {
|
|
||||||
PageResult<AiChatRoleDO> pageResult = chatRoleService.getChatRolePage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiChatRoleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiModelPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiModelRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiModelSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiModelDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiModelService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 模型")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/model")
|
|
||||||
@Validated
|
|
||||||
public class AiModelController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiModelService modelService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建模型")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:model:create')")
|
|
||||||
public CommonResult<Long> createModel(@Valid @RequestBody AiModelSaveReqVO createReqVO) {
|
|
||||||
return success(modelService.createModel(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新模型")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:model:update')")
|
|
||||||
public CommonResult<Boolean> updateModel(@Valid @RequestBody AiModelSaveReqVO updateReqVO) {
|
|
||||||
modelService.updateModel(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除模型")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:model:delete')")
|
|
||||||
public CommonResult<Boolean> deleteModel(@RequestParam("id") Long id) {
|
|
||||||
modelService.deleteModel(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得模型")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:model:query')")
|
|
||||||
public CommonResult<AiModelRespVO> getModel(@RequestParam("id") Long id) {
|
|
||||||
AiModelDO model = modelService.getModel(id);
|
|
||||||
return success(BeanUtils.toBean(model, AiModelRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得模型分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:model:query')")
|
|
||||||
public CommonResult<PageResult<AiModelRespVO>> getModelPage(@Valid AiModelPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiModelDO> pageResult = modelService.getModelPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiModelRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/simple-list")
|
|
||||||
@Operation(summary = "获得模型列表")
|
|
||||||
@Parameter(name = "type", description = "类型", required = true, example = "1")
|
|
||||||
@Parameter(name = "platform", description = "平台", example = "midjourney")
|
|
||||||
public CommonResult<List<AiModelRespVO>> getModelSimpleList(
|
|
||||||
@RequestParam("type") Integer type,
|
|
||||||
@RequestParam(value = "platform", required = false) String platform) {
|
|
||||||
List<AiModelDO> list = modelService.getModelListByStatusAndType(
|
|
||||||
CommonStatusEnum.ENABLE.getStatus(), type, platform);
|
|
||||||
return success(convertList(list, model -> new AiModelRespVO().setId(model.getId())
|
|
||||||
.setName(model.getName()).setModel(model.getModel()).setPlatform(model.getPlatform())));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool.AiToolPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool.AiToolRespVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool.AiToolSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiToolDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiToolService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 工具")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/tool")
|
|
||||||
@Validated
|
|
||||||
public class AiToolController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiToolService toolService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建工具")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:tool:create')")
|
|
||||||
public CommonResult<Long> createTool(@Valid @RequestBody AiToolSaveReqVO createReqVO) {
|
|
||||||
return success(toolService.createTool(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新工具")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:tool:update')")
|
|
||||||
public CommonResult<Boolean> updateTool(@Valid @RequestBody AiToolSaveReqVO updateReqVO) {
|
|
||||||
toolService.updateTool(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除工具")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:tool:delete')")
|
|
||||||
public CommonResult<Boolean> deleteTool(@RequestParam("id") Long id) {
|
|
||||||
toolService.deleteTool(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得工具")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:tool:query')")
|
|
||||||
public CommonResult<AiToolRespVO> getTool(@RequestParam("id") Long id) {
|
|
||||||
AiToolDO tool = toolService.getTool(id);
|
|
||||||
return success(BeanUtils.toBean(tool, AiToolRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得工具分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:tool:query')")
|
|
||||||
public CommonResult<PageResult<AiToolRespVO>> getToolPage(@Valid AiToolPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiToolDO> pageResult = toolService.getToolPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiToolRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/simple-list")
|
|
||||||
@Operation(summary = "获得工具列表")
|
|
||||||
public CommonResult<List<AiToolRespVO>> getToolSimpleList() {
|
|
||||||
List<AiToolDO> list = toolService.getToolListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
|
||||||
return success(convertList(list, tool -> new AiToolRespVO()
|
|
||||||
.setId(tool.getId()).setName(tool.getName())));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI API 密钥分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiApiKeyPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "名称", example = "文心一言")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "平台", example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "状态", example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI API 密钥 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiApiKeyRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23538")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "文心一言")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "密钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC")
|
|
||||||
private String apiKey;
|
|
||||||
|
|
||||||
@Schema(description = "平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "自定义 API 地址", example = "https://aip.baidubce.com")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI API 密钥新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiApiKeySaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23538")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "文心一言")
|
|
||||||
@NotEmpty(message = "名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "密钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC")
|
|
||||||
@NotEmpty(message = "密钥不能为空")
|
|
||||||
private String apiKey;
|
|
||||||
|
|
||||||
@Schema(description = "平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "OpenAI")
|
|
||||||
@NotEmpty(message = "平台不能为空")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "自定义 API 地址", example = "https://aip.baidubce.com")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天角色分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatRolePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "角色名称", example = "李四")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "角色类别", example = "创作")
|
|
||||||
private String category;
|
|
||||||
|
|
||||||
@Schema(description = "是否公开", example = "1")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiModelDO;
|
|
||||||
import com.fhs.core.trans.anno.Trans;
|
|
||||||
import com.fhs.core.trans.constant.TransType;
|
|
||||||
import com.fhs.core.trans.vo.VO;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天角色 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatRoleRespVO implements VO {
|
|
||||||
|
|
||||||
@Schema(description = "角色编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32746")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9442")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", example = "17640")
|
|
||||||
@Trans(type = TransType.SIMPLE, target = AiModelDO.class, fields = { "name", "model" }, refs = { "modelName", "model" })
|
|
||||||
private Long modelId;
|
|
||||||
@Schema(description = "模型名字", example = "张三")
|
|
||||||
private String modelName;
|
|
||||||
@Schema(description = "模型标识", example = "gpt-3.5-turbo-0125")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "角色头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@Schema(description = "角色类别", requiredMode = Schema.RequiredMode.REQUIRED, example = "创作")
|
|
||||||
private String category;
|
|
||||||
|
|
||||||
@Schema(description = "角色排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "角色描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "角色设定", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private String systemMessage;
|
|
||||||
|
|
||||||
@Schema(description = "引用的知识库编号列表", example = "1,2,3")
|
|
||||||
private List<Long> knowledgeIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的工具编号列表", example = "1,2,3")
|
|
||||||
private List<Long> toolIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的 MCP Client 名字列表", example = "filesystem")
|
|
||||||
private List<String> mcpClientNames;
|
|
||||||
|
|
||||||
@Schema(description = "是否公开", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "状态", example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.hibernate.validator.constraints.URL;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天角色新增/修改【我的】 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatRoleSaveMyReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "角色编号", example = "32746")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
|
||||||
@NotEmpty(message = "角色名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "角色头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
|
|
||||||
@NotEmpty(message = "角色头像不能为空")
|
|
||||||
@URL(message = "角色头像必须是 URL 格式")
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@Schema(description = "角色描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
|
||||||
@NotEmpty(message = "角色描述不能为空")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "角色设定", requiredMode = Schema.RequiredMode.REQUIRED, example = "现在开始你扮演一位程序员,你是一名优秀的程序员,具有很强的逻辑思维能力,总能高效的解决问题")
|
|
||||||
@NotEmpty(message = "角色设定不能为空")
|
|
||||||
private String systemMessage;
|
|
||||||
|
|
||||||
@Schema(description = "引用的知识库编号列表", example = "1,2,3")
|
|
||||||
private List<Long> knowledgeIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的工具编号列表", example = "1,2,3")
|
|
||||||
private List<Long> toolIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的 MCP Client 名字列表", example = "filesystem")
|
|
||||||
private List<String> mcpClientNames;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import org.hibernate.validator.constraints.URL;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 聊天角色新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiChatRoleSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "角色编号", example = "32746")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "模型编号", example = "17640")
|
|
||||||
private Long modelId;
|
|
||||||
|
|
||||||
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
|
||||||
@NotEmpty(message = "角色名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "角色头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
|
|
||||||
@NotEmpty(message = "角色头像不能为空")
|
|
||||||
@URL(message = "角色头像必须是 URL 格式")
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@Schema(description = "角色类别", requiredMode = Schema.RequiredMode.REQUIRED, example = "创作")
|
|
||||||
@NotEmpty(message = "角色类别不能为空")
|
|
||||||
private String category;
|
|
||||||
|
|
||||||
@Schema(description = "角色排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "角色排序不能为空")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "角色描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
|
||||||
@NotEmpty(message = "角色描述不能为空")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "角色设定", requiredMode = Schema.RequiredMode.REQUIRED, example = "现在开始你扮演一位程序员,你是一名优秀的程序员,具有很强的逻辑思维能力,总能高效的解决问题")
|
|
||||||
@NotEmpty(message = "角色设定不能为空")
|
|
||||||
private String systemMessage;
|
|
||||||
|
|
||||||
@Schema(description = "引用的知识库编号列表", example = "1,2,3")
|
|
||||||
private List<Long> knowledgeIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的工具编号列表", example = "1,2,3")
|
|
||||||
private List<Long> toolIds;
|
|
||||||
|
|
||||||
@Schema(description = "引用的 MCP Client 名字列表", example = "filesystem")
|
|
||||||
private List<String> mcpClientNames;
|
|
||||||
|
|
||||||
@Schema(description = "是否公开", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "是否公开不能为空")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.model;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - API 模型分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiModelPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "模型名字", example = "张三")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "模型标识", example = "gpt-3.5-turbo-0125")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "模型平台", example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.model;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 模型 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiModelRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2630")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "API 秘钥编号", example = "22042")
|
|
||||||
private Long keyId;
|
|
||||||
|
|
||||||
@Schema(description = "模型名字", example = "张三")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "模型标识", example = "gpt-3.5-turbo-0125")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "模型平台", example = "OpenAI")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "模型类型", example = "1")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "排序", example = "1")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "状态", example = "2")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "温度参数", example = "1")
|
|
||||||
private Double temperature;
|
|
||||||
|
|
||||||
@Schema(description = "单条回复的最大 Token 数量", example = "4096")
|
|
||||||
private Integer maxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "上下文的最大 Message 数量", example = "8192")
|
|
||||||
private Integer maxContexts;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.model;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.ai.enums.model.AiModelTypeEnum;
|
|
||||||
import cn.iocoder.yudao.module.ai.enums.model.AiPlatformEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - API 模型新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiModelSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", example = "2630")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "API 秘钥编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22042")
|
|
||||||
@NotNull(message = "API 秘钥编号不能为空")
|
|
||||||
private Long keyId;
|
|
||||||
|
|
||||||
@Schema(description = "模型名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
|
||||||
@NotEmpty(message = "模型名字不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "模型标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "gpt-3.5-turbo-0125")
|
|
||||||
@NotEmpty(message = "模型标识不能为空")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "模型平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "OpenAI")
|
|
||||||
@NotEmpty(message = "模型平台不能为空")
|
|
||||||
@InEnum(AiPlatformEnum.class)
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "模型类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "模型类型不能为空")
|
|
||||||
@InEnum(AiModelTypeEnum.class)
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "排序不能为空")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "温度参数", example = "1")
|
|
||||||
private Double temperature;
|
|
||||||
|
|
||||||
@Schema(description = "单条回复的最大 Token 数量", example = "4096")
|
|
||||||
private Integer maxTokens;
|
|
||||||
|
|
||||||
@Schema(description = "上下文的最大 Message 数量", example = "8192")
|
|
||||||
private Integer maxContexts;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool;
|
|
||||||
|
|
||||||
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.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 工具分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiToolPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "工具名称", example = "王五")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "工具描述", example = "你猜")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "状态", example = "1")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 工具 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiToolRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "工具编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19661")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "工具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "工具描述", example = "你猜")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.model.vo.tool;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 工具新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiToolSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "工具编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19661")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "工具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
|
||||||
@NotEmpty(message = "工具名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "工具描述", example = "你猜")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
### 生成音乐:Suno + 歌词模式
|
|
||||||
POST {{baseUrl}}/ai/music/generate
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"platform": "Suno",
|
|
||||||
"generateMode": 2,
|
|
||||||
"prompt": "创作一首带有轻松吉他旋律的流行歌曲,[verse] 描述夏日海滩的宁静,[chorus] 节奏加快,表达对自由的向往。",
|
|
||||||
"model": "chirp-v3.5",
|
|
||||||
"tags": ["Happy"],
|
|
||||||
"title": "Happy Song"
|
|
||||||
}
|
|
||||||
|
|
||||||
### 生成音乐:Suno + 描述模式
|
|
||||||
POST {{baseUrl}}/ai/music/generate
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"platform": "Suno",
|
|
||||||
"generateMode": 1,
|
|
||||||
"model": "chirp-v3.5",
|
|
||||||
"prompt": "happy music",
|
|
||||||
"makeInstrumental": false
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.music.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.music.AiMusicDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.music.AiMusicService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 音乐")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/music")
|
|
||||||
public class AiMusicController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiMusicService musicService;
|
|
||||||
|
|
||||||
@GetMapping("/my-page")
|
|
||||||
@Operation(summary = "获得【我的】音乐分页")
|
|
||||||
public CommonResult<PageResult<AiMusicRespVO>> getMusicMyPage(@Valid AiMusicPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiMusicDO> pageResult = musicService.getMusicMyPage(pageReqVO, getLoginUserId());
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiMusicRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/generate")
|
|
||||||
@Operation(summary = "音乐生成")
|
|
||||||
public CommonResult<List<Long>> generateMusic(@RequestBody @Valid AiSunoGenerateReqVO reqVO) {
|
|
||||||
return success(musicService.generateMusic(getLoginUserId(), reqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除【我的】音乐记录")
|
|
||||||
@DeleteMapping("/delete-my")
|
|
||||||
@Parameter(name = "id", required = true, description = "音乐编号", example = "1024")
|
|
||||||
public CommonResult<Boolean> deleteMusicMy(@RequestParam("id") Long id) {
|
|
||||||
musicService.deleteMusicMy(id, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-my")
|
|
||||||
@Operation(summary = "获取【我的】音乐")
|
|
||||||
@Parameter(name = "id", required = true, description = "音乐编号", example = "1024")
|
|
||||||
public CommonResult<AiMusicRespVO> getMusicMy(@RequestParam("id") Long id) {
|
|
||||||
AiMusicDO music = musicService.getMusic(id);
|
|
||||||
if (music == null || ObjUtil.notEqual(getLoginUserId(), music.getUserId())) {
|
|
||||||
return success(null);
|
|
||||||
}
|
|
||||||
return success(BeanUtils.toBean(music, AiMusicRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/update-my")
|
|
||||||
@Operation(summary = "修改【我的】音乐 目前只支持修改标题")
|
|
||||||
@Parameter(name = "title", required = true, description = "音乐名称", example = "夜空中最亮的星")
|
|
||||||
public CommonResult<Boolean> updateMy(AiMusicUpdateMyReqVO updateReqVO) {
|
|
||||||
musicService.updateMyMusic(updateReqVO, getLoginUserId());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================ 音乐管理 ================
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得音乐分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:music:query')")
|
|
||||||
public CommonResult<PageResult<AiMusicRespVO>> getMusicPage(@Valid AiMusicPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiMusicDO> pageResult = musicService.getMusicPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiMusicRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除音乐")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:music:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMusic(@RequestParam("id") Long id) {
|
|
||||||
musicService.deleteMusic(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新音乐")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:music:update')")
|
|
||||||
public CommonResult<Boolean> updateMusic(@Valid @RequestBody AiMusicUpdateReqVO updateReqVO) {
|
|
||||||
musicService.updateMusic(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import cn.iocoder.yudao.module.ai.enums.music.AiMusicGenerateModeEnum;
|
|
||||||
import cn.iocoder.yudao.module.ai.enums.music.AiMusicStatusEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 音乐分页 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMusicPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", example = "12212")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "音乐名称", example = "夜空中最亮的星")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "音乐状态", example = "20")
|
|
||||||
@InEnum(AiMusicStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "生成模式", example = "1")
|
|
||||||
@InEnum(AiMusicGenerateModeEnum.class)
|
|
||||||
private Integer generateMode;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", example = "true")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 音乐 Response VO")
|
|
||||||
@Data
|
|
||||||
public class AiMusicRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24790")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12212")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "音乐名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "夜空中最亮的星")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "歌词", example = "oh~卖糕的")
|
|
||||||
private String lyric;
|
|
||||||
|
|
||||||
@Schema(description = "图片地址", example = "https://www.iocoder.cn")
|
|
||||||
private String imageUrl;
|
|
||||||
|
|
||||||
@Schema(description = "音频地址", example = "https://www.iocoder.cn")
|
|
||||||
private String audioUrl;
|
|
||||||
|
|
||||||
@Schema(description = "视频地址", example = "https://www.iocoder.cn")
|
|
||||||
private String videoUrl;
|
|
||||||
|
|
||||||
@Schema(description = "音乐状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "描述词", example = "一首轻快的歌曲")
|
|
||||||
private String gptDescriptionPrompt;
|
|
||||||
|
|
||||||
@Schema(description = "提示词", example = "创作一首带有轻松吉他旋律的流行歌曲,[verse] 描述夏日海滩的宁静,[chorus] 节奏加快,表达对自由的向往。")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "模型平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "Suno")
|
|
||||||
private String platform;
|
|
||||||
|
|
||||||
@Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "chirp-v3.5")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "生成模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer generateMode;
|
|
||||||
|
|
||||||
@Schema(description = "音乐风格标签")
|
|
||||||
private List<String> tags;
|
|
||||||
|
|
||||||
@Schema(description = "音乐时长", example = "[\"pop\",\"jazz\",\"punk\"]")
|
|
||||||
private Double duration;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
@Schema(description = "任务编号", example = "11369")
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
@Schema(description = "错误信息")
|
|
||||||
private String errorMessage;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 修改我的音乐 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMusicUpdateMyReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15583")
|
|
||||||
@NotNull(message = "编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "音乐名称", example = "夜空中最亮的星")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 音乐修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiMusicUpdateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15583")
|
|
||||||
@NotNull(message = "编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "是否发布", example = "true")
|
|
||||||
private Boolean publicStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.music.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - AI 音乐生成 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AiSunoGenerateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "平台", requiredMode = Schema.RequiredMode.REQUIRED, example = "Suno")
|
|
||||||
@NotBlank(message = "平台不能为空")
|
|
||||||
private String platform; // 参见 AiPlatformEnum 枚举
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. 描述模式:描述词 + 是否纯音乐 + 模型
|
|
||||||
* 2. 歌词模式:歌词 + 音乐风格 + 标题 + 模型
|
|
||||||
*/
|
|
||||||
@Schema(description = "生成模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
|
||||||
@NotNull(message = "生成模式不能为空")
|
|
||||||
private Integer generateMode; // 参见 AiMusicGenerateModeEnum 枚举
|
|
||||||
|
|
||||||
@Schema(description = "用于生成音乐音频的歌词提示",
|
|
||||||
example = """
|
|
||||||
1.描述模式:创作一首带有轻松吉他旋律的流行歌曲,[verse] 描述夏日海滩的宁静,[chorus] 节奏加快,表达对自由的向往。
|
|
||||||
2.歌词模式:
|
|
||||||
[Verse]
|
|
||||||
阳光下奔跑 多么欢快
|
|
||||||
假期就要来 心都飞起来
|
|
||||||
朋友在一旁 笑声又灿烂
|
|
||||||
无忧无虑的 每一天甜蜜
|
|
||||||
[Chorus]
|
|
||||||
马上放假了 快来庆祝
|
|
||||||
一起去旅行 快去冒险
|
|
||||||
日子太短暂 别再等待
|
|
||||||
马上放假了 梦想起飞
|
|
||||||
""")
|
|
||||||
private String prompt;
|
|
||||||
|
|
||||||
@Schema(description = "是否纯音乐", example = "true")
|
|
||||||
private Boolean makeInstrumental;
|
|
||||||
|
|
||||||
@Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "chirp-v3.5")
|
|
||||||
@NotEmpty(message = "模型不能为空")
|
|
||||||
private String model;
|
|
||||||
|
|
||||||
@Schema(description = "音乐风格", example = "[\"pop\",\"jazz\",\"punk\"]")
|
|
||||||
private List<String> tags;
|
|
||||||
|
|
||||||
@Schema(description = "音乐/歌曲名称", example = "夜空中最亮的星")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
### 测试 AI 工作流
|
|
||||||
POST {{baseUrl}}/ai/workflow/test
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
tenant-id: {{adminTenantId}}
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"params": {
|
|
||||||
"message": "1 + 1 = ?"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.ai.controller.admin.workflow;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.workflow.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.workflow.AiWorkflowDO;
|
|
||||||
import cn.iocoder.yudao.module.ai.service.workflow.AiWorkflowService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - AI 工作流")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai/workflow")
|
|
||||||
@Slf4j
|
|
||||||
public class AiWorkflowController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AiWorkflowService workflowService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建 AI 工作流")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:create')")
|
|
||||||
public CommonResult<Long> createWorkflow(@Valid @RequestBody AiWorkflowSaveReqVO createReqVO) {
|
|
||||||
return success(workflowService.createWorkflow(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新 AI 工作流")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:update')")
|
|
||||||
public CommonResult<Boolean> updateWorkflow(@Valid @RequestBody AiWorkflowSaveReqVO updateReqVO) {
|
|
||||||
workflowService.updateWorkflow(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除 AI 工作流")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:delete')")
|
|
||||||
public CommonResult<Boolean> deleteWorkflow(@RequestParam("id") Long id) {
|
|
||||||
workflowService.deleteWorkflow(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得 AI 工作流")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:query')")
|
|
||||||
public CommonResult<AiWorkflowRespVO> getWorkflow(@RequestParam("id") Long id) {
|
|
||||||
AiWorkflowDO workflow = workflowService.getWorkflow(id);
|
|
||||||
return success(BeanUtils.toBean(workflow, AiWorkflowRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得 AI 工作流分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:query')")
|
|
||||||
public CommonResult<PageResult<AiWorkflowRespVO>> getWorkflowPage(@Valid AiWorkflowPageReqVO pageReqVO) {
|
|
||||||
PageResult<AiWorkflowDO> pageResult = workflowService.getWorkflowPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, AiWorkflowRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/test")
|
|
||||||
@Operation(summary = "测试 AI 工作流")
|
|
||||||
@PreAuthorize("@ss.hasPermission('ai:workflow:test')")
|
|
||||||
public CommonResult<Object> testWorkflow(@Valid @RequestBody AiWorkflowTestReqVO testReqVO) {
|
|
||||||
return success(workflowService.testWorkflow(testReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user