mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-19 00:57:14 +08:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
2f0d5d6b63 | |||
442e505c26 | |||
4779887751 | |||
56f67d9089 | |||
43da462560 | |||
6435175dc3 | |||
2109789116 | |||
dc5425dd67 | |||
a50d857c41 | |||
c9cda12b7d | |||
45307a8054 | |||
3e84384eb6 | |||
6d959f5e3e | |||
3d77aa91ee | |||
b9ce3f56f1 | |||
70973db71f | |||
1c1ec69030 | |||
bef0732f63 | |||
594f7fd042 | |||
860ca403c2 | |||
b5d668e014 | |||
8fe85e3a90 | |||
c03c082d2e | |||
![]() |
e4180fb976 | ||
d5716d661f | |||
bcdcf888fb | |||
03038d3b64 | |||
d972a4466a | |||
a2420d3f4b | |||
a154abde8a | |||
f6a9581ade | |||
acee7bfb6b | |||
15b152008c | |||
9648cf64a4 | |||
2df4cceedd | |||
439f7c7c58 | |||
44f9b2be34 |
51
.github/workflows/deploy.yml
vendored
51
.github/workflows/deploy.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
uses: actions/setup-java@master
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '17'
|
||||
java-version: 17
|
||||
cache: 'maven'
|
||||
# 3、打包
|
||||
- name: Build
|
||||
@@ -45,4 +45,51 @@ jobs:
|
||||
script: |
|
||||
cd /docker
|
||||
docker-compose up --force-recreate --build -d continew-admin-server
|
||||
docker images | grep none | awk '{print $3}' | xargs docker rmi
|
||||
docker images | grep none | awk '{print $3}' | xargs docker rmi
|
||||
# Qodana 扫描
|
||||
qodana-scan:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
checks: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
|
||||
fetch-depth: 0 # a full history is required for pull request analysis
|
||||
- name: Analyze
|
||||
uses: JetBrains/qodana-action@v2023.3
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
# Sonar 扫描
|
||||
sonar-scan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@master
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 17
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-sonar
|
||||
restore-keys: ${{ runner.os }}-sonar
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
- name: Analyze
|
||||
run: mvn -B verify -Psonar
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
38
CHANGELOG.md
38
CHANGELOG.md
@@ -1,3 +1,41 @@
|
||||
## [v2.4.0](https://github.com/Charles7c/continew-admin/compare/v2.3.0...v2.4.0) (2024-02-16)
|
||||
|
||||
### ✨ 新特性
|
||||
|
||||
* 集成 TLog(轻量级的分布式日志标记追踪神器) ([Gitee PR#10](https://gitee.com/Charles7c/continew-admin/pulls/10))
|
||||
* 系统日志新增 traceId 链路号记录,方便查看完整日志链路 ([860ca40](https://github.com/Charles7c/continew-admin/commit/860ca403c2c32cc6395c1608217bc9b6e7c18bd8))
|
||||
* 取消用户默认密码,改为表单填写密码 ([3d77aa9](https://github.com/Charles7c/continew-admin/commit/3d77aa91ee32065b53d9c47a57c33d6d7e4efb0e))
|
||||
* 适配 ContiNew Starter 加密模块(安全模块) ([6435175](https://github.com/Charles7c/continew-admin/commit/6435175dc3d853cb170270e39e8f1505adffeae5)) ([43da462](https://github.com/Charles7c/continew-admin/commit/43da462560e224ed92f239cb5af4db64dea51d18))
|
||||
* 适配 ContiNew Starter 脱敏模块(安全模块) ([2109789](https://github.com/Charles7c/continew-admin/commit/2109789116d9ff18773d8afeb854d1dfc70b935a))
|
||||
|
||||
### 💎 功能优化
|
||||
|
||||
- 优化 API 文档分组配置 ([2df4cce](https://github.com/Charles7c/continew-admin/commit/2df4cceedd35b1c2c07bcbf38b5a157604a752c2))
|
||||
- 优化 QueryTypeEnum 枚举值命名 ([9648cf6](https://github.com/Charles7c/continew-admin/commit/9648cf64a4679657f0e609f980805d274563aa53))
|
||||
- 优化 Query 相关注解使用方式 ([15b1520](https://github.com/Charles7c/continew-admin/commit/15b152008c6ae8ab89704d83a969dcfbbb8b5b88))
|
||||
- 新增 Qodana 扫描 ([f6a9581](https://github.com/Charles7c/continew-admin/commit/f6a9581adef87a8915639e6cb2d7c4d02315ebd0))
|
||||
- 新增 SonarCloud 扫描 ([a154abd](https://github.com/Charles7c/continew-admin/commit/a154abde8a39cfecc421c79e01998274b944d2c1)) ([c03c082](https://github.com/Charles7c/continew-admin/commit/c03c082d2e2884962547633f5e98663088bd2c3b))
|
||||
- 移除 Lombok 私有构造注解使用 ([a2420d3](https://github.com/Charles7c/continew-admin/commit/a2420d3f4b4652a1d9711f513b8fb22a56105141))
|
||||
- 获取不到当前登录用户信息则抛出未登录异常 ([d972a44](https://github.com/Charles7c/continew-admin/commit/d972a4466a9e8a1a6e6375e4171a4790c2ba156e))
|
||||
- 优化代码,解决 [Sonar](https://sonarcloud.io/organizations/charles7c/projects)、[Codacy](https://app.codacy.com/gh/Charles7c/continew-admin/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)、[Qodana](https://qodana.cloud/organizations/pQDPD/teams/p5jqd/) 扫描问题,点击各链接查看对应实时质量分析报告(Codacy 已达到 A)
|
||||
- 优化部署配置 ([b5d668e](https://github.com/Charles7c/continew-admin/commit/b5d668e014690d3f1a8a2bab0d0ad0039083e7bb))
|
||||
- 使用密码编码器重构密码加密、密码判断等相关处理 ([594f7fd](https://github.com/Charles7c/continew-admin/commit/594f7fd042f1ff96a298f2e59ffdda112113cb51))
|
||||
- 优化 SaToken 及图形验证码配置 ([70973db](https://github.com/Charles7c/continew-admin/commit/70973db71f2eed49c5878d69d8b93ff04b13a8b9))
|
||||
- 优化图形验证码使用及部分配置 ([a50d857](https://github.com/Charles7c/continew-admin/commit/a50d857c41d164355d36ae5dfd14c6badbe06202))
|
||||
|
||||
|
||||
### 🐛 问题修复
|
||||
|
||||
- 修复 API 响应内容类型错误 ([439f7c7](https://github.com/Charles7c/continew-admin/commit/439f7c7c58ee27ff56b5093df71bc902c46f48fa))
|
||||
|
||||
### 💥 破坏性变更
|
||||
|
||||
- 调整自增 ID 为分布式 ID ([4779887](https://github.com/Charles7c/continew-admin/commit/4779887751bd3a696e4d31294057e8c03d66eaf3))
|
||||
|
||||
### 📦 依赖升级
|
||||
|
||||
- ContiNew Starter 1.2.0 => 1.4.0 (更多依赖升级详情,请查看 ContiNew Starter [更新日志](https://github.com/Charles7c/continew-starter/blob/dev/CHANGELOG.md))
|
||||
|
||||
## [v2.3.0](https://github.com/Charles7c/continew-admin/compare/v2.2.0...v2.3.0) (2024-01-21)
|
||||
|
||||
### ✨ 新特性
|
||||
|
131
README.md
131
README.md
@@ -4,7 +4,22 @@
|
||||
<img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-admin" target="_blank">
|
||||
<img src="https://img.shields.io/badge/RELEASE-v2.3.0-%23ff3f59.svg" alt="Release" />
|
||||
<img src="https://img.shields.io/badge/RELEASE-v2.4.0-%23ff3f59.svg" alt="Release" />
|
||||
</a>
|
||||
<a href="https://app.codacy.com/gh/Charles7c/continew-admin/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade" target="_blank">
|
||||
<img src="https://app.codacy.com/project/badge/Grade/19e3e2395d554efe902c3822e65db30e" alt="Codacy Badge" />
|
||||
</a>
|
||||
<a href="https://sonarcloud.io/summary/new_code?id=Charles7c_continew-admin" target="_blank">
|
||||
<img src="https://sonarcloud.io/api/project_badges/measure?project=Charles7c_continew-admin&metric=alert_status" alt="Sonar Status" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-starter" target="_blank">
|
||||
<img src="https://img.shields.io/badge/ContiNew Starter-1.4.0-%236CB52D.svg" alt="ContiNew Starter" />
|
||||
</a>
|
||||
<a href="https://spring.io/projects/spring-boot" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Spring Boot-3.1.8-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-starter" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Open JDK-17-%236CB52D.svg?logo=OpenJDK&logoColor=FFF" alt="Open JDK" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-admin" target="_blank">
|
||||
<img src="https://img.shields.io/github/stars/Charles7c/continew-admin?style=social" alt="GitHub stars" />
|
||||
@@ -18,15 +33,6 @@
|
||||
<a href="https://gitee.com/Charles7c/continew-admin" target="_blank">
|
||||
<img src="https://gitee.com/Charles7c/continew-admin/badge/fork.svg?theme=white" alt="Gitee forks" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-starter" target="_blank">
|
||||
<img src="https://img.shields.io/badge/ContiNew Starter-1.2.0-%236CB52D.svg" alt="Release" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-starter" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Spring Boot-3.1.7-%236CB52D.svg" alt="Release" />
|
||||
</a>
|
||||
<a href="https://github.com/Charles7c/continew-starter" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Java-17-%236CB52D.svg" alt="Release" />
|
||||
</a>
|
||||
|
||||
📚 [在线文档](https://doc.charles7c.top) | 🚀 [演示地址](https://cnadmin.charles7c.top)(账号/密码:admin/admin123)
|
||||
|
||||
@@ -61,42 +67,43 @@ ContiNew Admin(Continue New Admin)持续迭代优化的前后端分离中后
|
||||
| GitHub | [github.com/Charles7c/continew-admin](https://github.com/Charles7c/continew-admin) | [github.com/Charles7c/continew-admin-ui](https://github.com/Charles7c/continew-admin-ui) |
|
||||
| Gitee | [gitee.com/Charles7c/continew-admin](https://gitee.com/Charles7c/continew-admin) | [gitee.com/Charles7c/continew-admin-ui](https://gitee.com/Charles7c/continew-admin-ui) |
|
||||
|
||||
## 主要特性
|
||||
## 为什么选我们?
|
||||
|
||||
- :fire: 下方通用基础能力及配置,在 v2.1.0 版本已抽取到 [ContiNew Starter](https://github.com/Charles7c/continew-starter) 项目,现 [已发布至 Maven 中央仓库](https://central.sonatype.com/search?q=continew-starter),为 Spring Boot Web 项目开发提供更灵活的助力
|
||||
> [!TIP]
|
||||
> 如需完整图文描述,请点击打开[《在线文档》](https://doc.charles7c.top/admin/intro/why.html)查阅。
|
||||
|
||||
- 精选技术栈:使用综合考虑成熟度、流行性、发展潜力较佳的技术栈,包括 Spring Boot、MyBatis Plus、Sa-Token、Hutool 等
|
||||
1.**甄选技术栈:** ContiNew(Continue New) 项目致力于持续迭代优化,让技术不掉队。在技术选型时,进行深度广泛地调研,从流行度、成熟度和发展潜力等多方面甄选技术栈。 e.g. 前端:Vue3 & Element Plus、TypeScript、Vite5;后端:Spring Boot、Sa-Token、MyBatis Plus、Redisson、JetCache、Crane4j、Hutool 等。
|
||||
|
||||
- 高效率开发:后端提供了 CRUD 组件,在 Controller 中只需添加一个注解,即可自动生成增、删、改、查、分页、列表、树列表等 API,且支持配置启用不同 API。
|
||||
2.**Starter 组件:** 从 v2.1.0 版本开始,抽取并封装后端基础组件及各框架集成配置到 ContiNew Starter 项目,且 **[已发布至 Maven 中央仓库](https://central.sonatype.com/search?q=continew-starter)**,可在你的任意项目中直接引入所需依赖使用。即使你不用脚手架项目,难道能让你搭项目框架更快、更爽、更省力的 Starter 也要 Say No 吗?
|
||||
|
||||
```java
|
||||
@Tag(name = "部门管理 API")
|
||||
@RestController
|
||||
@CrudRequestMapping(value = "/system/dept", api = {Api.TREE, Api.GET, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||
public class DeptController extends BaseController<DeptService, DeptResp, DeptDetailResp, DeptQuery, DeptReq> {}
|
||||
```
|
||||
3.**CRUD 套件:** 封装通用增删改查套件,适配后端各分层,几分钟即可提供一套 CRUD API,包括新增、修改、批量删除、查询详情、分页列表查询、全部列表查询、树型列表查询、导出到 Excel,且 API 支持按实际所需开放或扩展。
|
||||
```java
|
||||
@Tag(name = "部门管理 API")
|
||||
@RestController
|
||||
@CrudRequestMapping(value = "/system/dept", api = {Api.TREE, Api.GET, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||
public class DeptController extends BaseController<DeptService, DeptResponse, DeptDetailResponse, DeptQuery, DeptRequest> {}
|
||||
```
|
||||
|
||||
- 提供代码生成功能,根据用户提供的项目信息和配置,自动生成前后端项目结构、代码文件和部分逻辑代码,提高开发效率
|
||||
4.**代码生成器:** 提供代码生成器,已配套前、后端代码生成模板,数据表设计完之后,简单配置一下即可生成前、后端 80% 的代码,包含 CRUD API、权限控制、参数校验、接口文档等内容。如果业务不复杂,也可能就是 99% 的代码。
|
||||
|
||||
- 一个注解解决一个条件查询,基于注解的通用查询方式,降低拼接 MyBatis Plus QueryWrapper 的烦恼
|
||||
5.**改善开发体验:** 持续适配、优化能改善开发体验的组件。
|
||||
- 适配 Crane4j 数据填充组件,减少因为一个用户名而产生的联表回填;
|
||||
- 适配 P6Spy SQL 性能分析组件,开发期间方便监控 SQL 执行;
|
||||
- 适配 TLog 链路追踪组件,方便在杂乱的日志文件中追踪你某次请求的日志记录;
|
||||
- 适配 JetCache 缓存框架(比 Spring Cache 更强大易用),通过注解声明即可快速实现方法级缓存,极大改善编码式缓存体验,且支持灵活的二级缓存配置、分布式自动刷新等能力;
|
||||
- 适配 ContiNew Starter 组件,针对多数框架进行了深度封装的 starter,改善你在开发每个 Spring Boot Web 项目的体验。
|
||||
|
||||
- 提供一套 Base 基类(BaseDO、BaseResp、BaseController、BaseService、扩展版 BaseMapper 等),方便复用和扩展
|
||||
6.**Almost最佳后端规范:** 后端严格遵循阿里巴巴 Java 编码规范,注释覆盖率 > 45%,接口参数示例 100%,代码分层使用体验佳,变量、方法命名清晰统一,前端代码也使用严格的 ESLint、StyleLint 等检查。良好的设计,代码复用率极高!写代码时,让你有一种无需多写,理应如此的感觉。代码洁癖者的福音,不看莫吱声。
|
||||
|
||||
- 基于 Crane4j 实现灵活的数据填充功能,根除因为查询一个用户名而编写大量的填充代码
|
||||
7.**卓越工程:** 后端采用模块化工程结构,并适配了统一项目版本号、编译项目自动代码格式化、代码混淆等插件,提供了自定义打包部署结构配置(配置文件、三方依赖和主程序分离),提供全套环境及应用的 Docker Compose 部署脚本。为了减少您开发新项目时的改造耗时,项目品牌配置持续进行深度聚合,简单的配置和结构修改即可快速开始独属于你的新项目。
|
||||
|
||||
- 编写或基于 Hutool 扩展部分工具类,提供校验工具和实践,提高开发效率(能 PR 到 Hutool 的已尽量 PR)
|
||||
8.**业务脚手架:** 有颜有料,不止是说说而已。基于成熟的前端脚手架 [Fantastic Admin](https://fantastic-admin.gitee.io/) 开发的前端项目,持续打磨 UI 设计与色彩主题。提供基于 RBAC 的权限控制、通用数据权限,包含丰富的通用业务功能:第三方登录,邮箱、短信(生产级炸弹漏洞处理方案),用户管理、角色管理、组织管理、系统配置、系统日志、消息中心、公告等,设计用心,逻辑合理闭环。
|
||||
> 一个好的脚手架项目,不仅仅是提供一系列组件集成与配置,也不仅仅是封装一堆好用的工具,还更应该提供一系列通用基础业务解决方案及设计,为初创团队项目减负。
|
||||
|
||||
- 支持 API 级别的功能权限与数据权限,可自定义操作
|
||||
9.**高可靠代码:** 项目 CI 已集成 Sonarqube、Codacy、Qodana,Push 即触发代码质量扫描,并定期进行 CVE 漏洞扫描,及时解决潜在问题。
|
||||
|
||||
- 前后端统一异常拦截处理,统一输出异常信息,避免繁琐的异常判断
|
||||
|
||||
- 自动初始化数据:通过 Liquibase 管理数据库脚本版本记录,并在系统第一次启动时自动进行数据初始化,无须额外配置导入
|
||||
|
||||
- 提供多项实用基础配置,例如:统一线程池配置、Jackson 针对日期、通用枚举的序列化、反序列化配置等
|
||||
|
||||
- 良好的代码、配置文件结构和命名,完善的代码注释甚至包括 Git Commit 信息、接口文档参数示例,遵循阿里巴巴 <a href="https://github.com/Charles7c/continew-admin/blob/dev/.style/Java%E5%BC%80%E5%8F%91%E6%89%8B%E5%86%8C(%E9%BB%84%E5%B1%B1%E7%89%88).pdf" target="_blank">《Java开发手册(黄山版)》</a> 的代码规范,保证代码质量和可维护性
|
||||
|
||||
- 更多细节及实践,敬请探索与关注
|
||||
由于篇幅有限,且项目正处于高速发展期,更多功能正在陆续上线(敬请关注仓库或群内动态)。另外像最基本的统一异常、错误处理,基础线程池等配置就不在此赘述,细节优化详情请 clone 代码查看。
|
||||
> Talk is cheap, show me the code.
|
||||
|
||||
## 系统功能
|
||||
|
||||
@@ -222,32 +229,32 @@ git clone https://github.com/Charles7c/continew-admin.git
|
||||
|
||||
## 核心技术栈
|
||||
|
||||
| 名称 | 版本 | 简介 |
|
||||
| :----------------------------------------------------------- | :----------- | :----------------------------------------------------------- |
|
||||
| [ContiNew Starter](https://github.com/Charles7c/continew-starter) | 1.2.0 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
|
||||
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.7 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
|
||||
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.10.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
|
||||
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.37.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
|
||||
| <a href="https://baomidou.com/" target="_blank">MyBatis Plus</a> | 3.5.4.1 | MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率。 |
|
||||
| <a href="https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611" target="_blank">dynamic-datasource-spring-boot-starter</a> | 4.2.0 | 基于 Spring Boot 的快速集成多数据源的启动器。 |
|
||||
| Hikari | 5.0.1 | JDBC 连接池,号称 “史上最快连接池”,SpringBoot 在 2.0 之后,采用的默认数据库连接池就是 Hikari。 |
|
||||
| <a href="https://dev.mysql.com/downloads/mysql/" target="_blank">MySQL</a> | 8.0.33 | 体积小、速度快、总体拥有成本低,是最流行的关系型数据库管理系统之一。 |
|
||||
| <a href="https://dev.mysql.com/doc/connector-j/8.0/en/" target="_blank">mysql-connector-j</a> | 8.0.33 | MySQL Java 驱动。 |
|
||||
| <a href="https://github.com/p6spy/p6spy" target="_blank">P6Spy</a> | 3.9.1 | SQL 性能分析组件。 |
|
||||
| <a href="https://github.com/liquibase/liquibase" target="_blank">Liquibase</a> | 4.20.0 | 用于管理数据库版本,跟踪、管理和应用数据库变化。 |
|
||||
| [JetCache](https://github.com/alibaba/jetcache/blob/master/docs/CN/Readme.md) | 2.7.4 | 一个基于 Java 的缓存系统封装,提供统一的 API 和注解来简化缓存的使用。提供了比 SpringCache 更加强大的注解,可以原生的支持 TTL、两级缓存、分布式自动刷新,还提供了 Cache 接口用于手工缓存操作。 |
|
||||
| <a href="https://github.com/redisson/redisson/wiki/Redisson%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D" target="_blank">Redisson</a> | 3.25.2 | 不仅仅是一个 Redis Java 客户端,Redisson 充分的利用了 Redis 键值数据库提供的一系列优势,为使用者提供了一系列具有分布式特性的常用工具:分布式锁、限流器等。 |
|
||||
| <a href="https://redis.io/" target="_blank">Redis</a> | 7.2.3 | 高性能的 key-value 数据库。 |
|
||||
| [X File Storage](https://x-file-storage.xuyanwu.cn/#/) | 2.0.0 | 一行代码将文件存储到本地、FTP、SFTP、WebDAV、阿里云 OSS、华为云 OBS...等其它兼容 S3 协议的存储平台。 |
|
||||
| <a href="https://sms4j.com/" target="_blank">SMS4J</a> | 3.0.4 | 短信聚合框架,轻松集成多家短信服务,解决接入多个短信 SDK 的繁琐流程。 |
|
||||
| <a href="https://justauth.cn/" target="_blank">Just Auth</a> | 1.16.6 | 开箱即用的整合第三方登录的开源组件,脱离繁琐的第三方登录 SDK,让登录变得 So easy! |
|
||||
| <a href="https://easyexcel.opensource.alibaba.com/" target="_blank">Easy Excel</a> | 3.3.3 | 一个基于 Java 的、快速、简洁、解决大文件内存溢出的 Excel 处理工具。 |
|
||||
| [AJ-Captcha](https://ajcaptcha.beliefteam.cn/captcha-doc/) | 1.3.0 | Java 行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。 |
|
||||
| Easy Captcha | 1.6.2 | Java 图形验证码,支持 gif、中文、算术等类型,可用于 Java Web、JavaSE 等项目。 |
|
||||
| [Crane4j](https://createsequence.gitee.io/crane4j-doc/#/) | 2.4.0 | 一个基于注解的,用于完成一切 “根据 A 的 key 值拿到 B,再把 B 的属性映射到 A” 这类需求的字段填充框架。 |
|
||||
| <a href="https://doc.xiaominfo.com/" target="_blank">Knife4j</a> | 4.4.0 | 前身是 swagger-bootstrap-ui,集 Swagger2 和 OpenAPI3 为一体的增强解决方案。 |
|
||||
| <a href="https://www.hutool.cn/" target="_blank">Hutool</a> | 5.8.24 | 小而全的 Java 工具类库,通过静态方法封装,降低相关 API 的学习成本,提高工作效率,使 Java 拥有函数式语言般的优雅,让 Java 语言也可以“甜甜的”。 |
|
||||
| <a href="https://projectlombok.org/" target="_blank">Lombok</a> | 1.18.30 | 在 Java 开发过程中用注解的方式,简化了 JavaBean 的编写,避免了冗余和样板式代码,让编写的类更加简洁。 |
|
||||
| 名称 | 版本 | 简介 |
|
||||
| :----------------------------------------------------------- |:--------------| :----------------------------------------------------------- |
|
||||
| [ContiNew Starter](https://github.com/Charles7c/continew-starter) | 1.4.0 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
|
||||
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.8 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
|
||||
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.10.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
|
||||
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.37.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
|
||||
| <a href="https://baomidou.com/" target="_blank">MyBatis Plus</a> | 3.5.5 | MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率。 |
|
||||
| <a href="https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611" target="_blank">dynamic-datasource-spring-boot-starter</a> | 4.3.0 | 基于 Spring Boot 的快速集成多数据源的启动器。 |
|
||||
| Hikari | 5.0.1 | JDBC 连接池,号称 “史上最快连接池”,SpringBoot 在 2.0 之后,采用的默认数据库连接池就是 Hikari。 |
|
||||
| <a href="https://dev.mysql.com/downloads/mysql/" target="_blank">MySQL</a> | 8.0.33 | 体积小、速度快、总体拥有成本低,是最流行的关系型数据库管理系统之一。 |
|
||||
| <a href="https://dev.mysql.com/doc/connector-j/8.0/en/" target="_blank">mysql-connector-j</a> | 8.0.33 | MySQL Java 驱动。 |
|
||||
| <a href="https://github.com/p6spy/p6spy" target="_blank">P6Spy</a> | 3.9.1 | SQL 性能分析组件。 |
|
||||
| <a href="https://github.com/liquibase/liquibase" target="_blank">Liquibase</a> | 4.20.0 | 用于管理数据库版本,跟踪、管理和应用数据库变化。 |
|
||||
| [JetCache](https://github.com/alibaba/jetcache/blob/master/docs/CN/Readme.md) | 2.7.5 | 一个基于 Java 的缓存系统封装,提供统一的 API 和注解来简化缓存的使用。提供了比 SpringCache 更加强大的注解,可以原生的支持 TTL、两级缓存、分布式自动刷新,还提供了 Cache 接口用于手工缓存操作。 |
|
||||
| <a href="https://github.com/redisson/redisson/wiki/Redisson%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D" target="_blank">Redisson</a> | 3.26.0 | 不仅仅是一个 Redis Java 客户端,Redisson 充分的利用了 Redis 键值数据库提供的一系列优势,为使用者提供了一系列具有分布式特性的常用工具:分布式锁、限流器等。 |
|
||||
| <a href="https://redis.io/" target="_blank">Redis</a> | 7.2.3 | 高性能的 key-value 数据库。 |
|
||||
| [X File Storage](https://x-file-storage.xuyanwu.cn/#/) | 2.1.0 | 一行代码将文件存储到本地、FTP、SFTP、WebDAV、阿里云 OSS、华为云 OBS...等其它兼容 S3 协议的存储平台。 |
|
||||
| <a href="https://sms4j.com/" target="_blank">SMS4J</a> | 3.1.1 | 短信聚合框架,轻松集成多家短信服务,解决接入多个短信 SDK 的繁琐流程。 |
|
||||
| <a href="https://justauth.cn/" target="_blank">Just Auth</a> | 1.16.6 | 开箱即用的整合第三方登录的开源组件,脱离繁琐的第三方登录 SDK,让登录变得 So easy! |
|
||||
| <a href="https://easyexcel.opensource.alibaba.com/" target="_blank">Easy Excel</a> | 3.3.3 | 一个基于 Java 的、快速、简洁、解决大文件内存溢出的 Excel 处理工具。 |
|
||||
| [AJ-Captcha](https://ajcaptcha.beliefteam.cn/captcha-doc/) | 1.3.0 | Java 行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。 |
|
||||
| Easy Captcha | 1.6.2 | Java 图形验证码,支持 gif、中文、算术等类型,可用于 Java Web、JavaSE 等项目。 |
|
||||
| [Crane4j](https://createsequence.gitee.io/crane4j-doc/#/) | 2.5.0 | 一个基于注解的,用于完成一切 “根据 A 的 key 值拿到 B,再把 B 的属性映射到 A” 这类需求的字段填充框架。 |
|
||||
| <a href="https://doc.xiaominfo.com/" target="_blank">Knife4j</a> | 4.5.0 | 前身是 swagger-bootstrap-ui,集 Swagger2 和 OpenAPI3 为一体的增强解决方案。 |
|
||||
| <a href="https://www.hutool.cn/" target="_blank">Hutool</a> | 5.8.25 | 小而全的 Java 工具类库,通过静态方法封装,降低相关 API 的学习成本,提高工作效率,使 Java 拥有函数式语言般的优雅,让 Java 语言也可以“甜甜的”。 |
|
||||
| <a href="https://projectlombok.org/" target="_blank">Lombok</a> | 1.18.30 | 在 Java 开发过程中用注解的方式,简化了 JavaBean 的编写,避免了冗余和样板式代码,让编写的类更加简洁。 |
|
||||
|
||||
## 项目结构
|
||||
|
||||
@@ -431,7 +438,7 @@ ContiNew Admin 的分支目前分为下个大版本的开发分支和上个大
|
||||
|
||||
### 特别鸣谢
|
||||
|
||||
- 感谢 <a href="https://www.jetbrains.com/" target="_blank">JetBrains</a> 提供的 <a href="https://www.jetbrains.com/shop/eform/opensource" target="_blank">非商业开源软件开发授权</a>
|
||||
- 感谢 <a href="https://www.jetbrains.com/" target="_blank">JetBrains</a> 提供的 <a href="https://jb.gg/OpenSourceSupport" target="_blank">非商业开源软件开发授权</a>
|
||||
- 感谢 <a href="https://github.com/baomidou/mybatis-plus" target="_blank">MyBatis Plus</a>、<a href="https://github.com/dromara/sa-token" target="_blank">Sa-Token</a> 、<a href="https://github.com/alibaba/jetcache" target="_blank">JetCache</a>、<a href="https://github.com/opengoofy/crane4j" target="_blank">Crane4j</a>、<a href="https://github.com/xiaoymin/knife4j" target="_blank">Knife4j</a>、<a href="https://github.com/dromara/hutool" target="_blank">Hutool</a> 等开源组件作者为国内开源世界作出的贡献
|
||||
- 感谢项目使用或未使用到的每一款开源组件,致敬各位开源先驱 :fire:
|
||||
|
||||
|
@@ -13,6 +13,16 @@
|
||||
<description>公共模块(存放公共工具类,公共配置等)</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- CosId(通用、灵活、高性能的分布式 ID 生成器) -->
|
||||
<dependency>
|
||||
<groupId>me.ahoo.cosid</groupId>
|
||||
<artifactId>cosid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.ahoo.cosid</groupId>
|
||||
<artifactId>cosid-spring-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SMS4J(短信聚合框架,轻松集成多家短信服务,解决接入多个短信 SDK 的繁琐流程) -->
|
||||
<dependency>
|
||||
<groupId>org.dromara.sms4j</groupId>
|
||||
@@ -96,6 +106,12 @@
|
||||
<artifactId>continew-starter-file-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- ContiNew Starter 安全模块(加密、脱敏、密码编码器) -->
|
||||
<dependency>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter-security-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- ContiNew Starter API 文档模块 -->
|
||||
<dependency>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
|
@@ -16,11 +16,7 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
@@ -28,6 +24,9 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Web MVC 配置
|
||||
*
|
||||
@@ -49,15 +48,15 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||
*/
|
||||
@Override
|
||||
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.removeIf(MappingJackson2HttpMessageConverter.class::isInstance);
|
||||
if (Objects.isNull(mappingJackson2HttpMessageConverter)) {
|
||||
converters.add(0, new MappingJackson2HttpMessageConverter());
|
||||
} else {
|
||||
converters.add(0, mappingJackson2HttpMessageConverter);
|
||||
}
|
||||
// 自定义 converters 时,需要手动在最前面添加 ByteArrayHttpMessageConverter
|
||||
// 否则 Spring Doc OpenAPI 的 /*/api-docs/**(例如:/v3/api-docs/default)接口响应内容会变为 Base64 编码后的内容,最终导致接口文档解析失败
|
||||
// 详情请参阅:https://github.com/springdoc/springdoc-openapi/issues/2143
|
||||
converters.add(new ByteArrayHttpMessageConverter());
|
||||
converters.removeIf(MappingJackson2HttpMessageConverter.class::isInstance);
|
||||
if (Objects.isNull(mappingJackson2HttpMessageConverter)) {
|
||||
converters.add(new MappingJackson2HttpMessageConverter());
|
||||
} else {
|
||||
converters.add(mappingJackson2HttpMessageConverter);
|
||||
}
|
||||
converters.add(0, new ByteArrayHttpMessageConverter());
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.continew.admin.common.config.mybatis;
|
||||
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import top.charles7c.continew.starter.security.crypto.encryptor.IEncryptor;
|
||||
|
||||
/**
|
||||
* BCrypt 加/解密处理器(不可逆)
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2024/2/8 22:29
|
||||
*/
|
||||
public class BCryptEncryptor implements IEncryptor {
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
public BCryptEncryptor(PasswordEncoder passwordEncoder) {
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String encrypt(String plaintext, String password, String publicKey) throws Exception {
|
||||
return passwordEncoder.encode(plaintext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decrypt(String ciphertext, String password, String privateKey) throws Exception {
|
||||
return ciphertext;
|
||||
}
|
||||
}
|
@@ -16,16 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config.mybatis;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
|
||||
import top.charles7c.continew.admin.common.model.dto.LoginUser;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermissionCurrentUser;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermissionFilter;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataScope;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 数据权限过滤器实现类
|
||||
*
|
||||
@@ -37,15 +36,12 @@ public class DataPermissionFilterImpl implements DataPermissionFilter {
|
||||
@Override
|
||||
public boolean isFilter() {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
return null != loginUser && !loginUser.isAdmin();
|
||||
return !loginUser.isAdmin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataPermissionCurrentUser getCurrentUser() {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (null == loginUser) {
|
||||
throw new IllegalArgumentException("Current user is not allowed to be empty.");
|
||||
}
|
||||
DataPermissionCurrentUser currentUser = new DataPermissionCurrentUser();
|
||||
currentUser.setUserId(Convert.toStr(loginUser.getId()));
|
||||
currentUser.setDeptId(Convert.toStr(loginUser.getDeptId()));
|
||||
|
@@ -16,17 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config.mybatis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.BaseMapper;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据权限 Mapper 基类
|
||||
*
|
||||
@@ -37,10 +35,23 @@ import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermi
|
||||
*/
|
||||
public interface DataPermissionMapper<T> extends BaseMapper<T> {
|
||||
|
||||
/**
|
||||
* 根据 entity 条件,查询全部记录
|
||||
*
|
||||
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
||||
* @return 全部记录
|
||||
*/
|
||||
@Override
|
||||
@DataPermission
|
||||
List<T> selectList(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据 entity 条件,查询全部记录(并翻页)
|
||||
*
|
||||
* @param page 分页查询条件
|
||||
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
||||
* @return 全部记录(并翻页)
|
||||
*/
|
||||
@Override
|
||||
@DataPermission
|
||||
List<T> selectList(IPage<T> page, @Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
||||
|
@@ -16,17 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config.mybatis;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.starter.core.exception.BusinessException;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* MyBatis Plus 元对象处理器配置(插入或修改时自动填充)
|
||||
|
@@ -21,6 +21,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermissionFilter;
|
||||
|
||||
/**
|
||||
@@ -47,4 +48,12 @@ public class MybatisPlusConfiguration {
|
||||
public DataPermissionFilter dataPermissionFilter() {
|
||||
return new DataPermissionFilterImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* BCrypt 加/解密处理器
|
||||
*/
|
||||
@Bean
|
||||
public BCryptEncryptor bCryptEncryptor(PasswordEncoder passwordEncoder) {
|
||||
return new BCryptEncryptor(passwordEncoder);
|
||||
}
|
||||
}
|
||||
|
@@ -16,16 +16,11 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config.properties;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.wf.captcha.*;
|
||||
|
||||
/**
|
||||
* 验证码配置属性
|
||||
*
|
||||
|
@@ -16,9 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.config.properties;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
|
||||
/**
|
||||
@@ -28,13 +25,15 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
* @author Charles7c
|
||||
* @since 2022/12/21 20:21
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class RsaProperties {
|
||||
|
||||
/** 私钥 */
|
||||
public static final String PRIVATE_KEY;
|
||||
|
||||
static {
|
||||
PRIVATE_KEY = SpringUtil.getProperty("rsa.privateKey");
|
||||
PRIVATE_KEY = SpringUtil.getProperty("continew-starter.security.crypto.private-key");
|
||||
}
|
||||
|
||||
private RsaProperties() {
|
||||
}
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
/**
|
||||
@@ -26,7 +24,6 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
* @author Charles7c
|
||||
* @since 2022/12/22 19:30
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class CacheConstants {
|
||||
|
||||
/**
|
||||
@@ -73,4 +70,7 @@ public class CacheConstants {
|
||||
* 仪表盘缓存键前缀
|
||||
*/
|
||||
public static final String DASHBOARD_KEY_PREFIX = "DASHBOARD" + DELIMITER;
|
||||
|
||||
private CacheConstants() {
|
||||
}
|
||||
}
|
||||
|
@@ -16,21 +16,31 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.constant.ContainerPool;
|
||||
|
||||
/**
|
||||
* 数据源容器相关常量(Crane4j 数据填充组件使用)
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2024/1/20 12:33
|
||||
*/
|
||||
public interface ContainerConstants extends top.charles7c.continew.starter.extension.crud.constant.ContainerConstants {
|
||||
public class ContainerConstants extends ContainerPool {
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
public static final String USER_NICKNAME = ContainerPool.USER_NICKNAME;
|
||||
|
||||
/**
|
||||
* 用户角色 ID 列表
|
||||
*/
|
||||
String USER_ROLE_ID_LIST = "UserRoleIdList";
|
||||
public static final String USER_ROLE_ID_LIST = "UserRoleIdList";
|
||||
|
||||
/**
|
||||
* 角色部门列表
|
||||
*/
|
||||
String ROLE_DEPT_ID_LIST = "RoleDeptIdList";
|
||||
public static final String ROLE_DEPT_ID_LIST = "RoleDeptIdList";
|
||||
|
||||
private ContainerConstants() {
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 文件相关常量
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/1/2 21:19
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class FileConstants {
|
||||
|
||||
/**
|
||||
* 头像支持的图片类型
|
||||
*/
|
||||
public static final String[] AVATAR_SUPPORTED_IMG_TYPES = {"jpg", "png", "gif", "jpeg"};
|
||||
}
|
@@ -16,19 +16,13 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
|
||||
/**
|
||||
* 正则相关常量
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/1/10 20:06
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class RegexConstants implements RegexPool {
|
||||
public class RegexConstants {
|
||||
|
||||
/**
|
||||
* 用户名正则(长度为 4 到 64 位,可以包含字母、数字,下划线,以字母开头)
|
||||
@@ -54,4 +48,7 @@ public class RegexConstants implements RegexPool {
|
||||
* 包名正则(可以包含大小写字母、数字、下划线,每一级包名不能以数字开头)
|
||||
*/
|
||||
public static final String PACKAGE_NAME = "^(?:[a-zA-Z_][a-zA-Z0-9_]*\\.)*[a-zA-Z_][a-zA-Z0-9_]*$";
|
||||
|
||||
private RegexConstants() {
|
||||
}
|
||||
}
|
||||
|
@@ -16,9 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
/**
|
||||
@@ -27,7 +24,6 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
* @author Charles7c
|
||||
* @since 2023/2/9 22:11
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class SysConstants {
|
||||
|
||||
/**
|
||||
@@ -50,11 +46,6 @@ public class SysConstants {
|
||||
*/
|
||||
public static final String ALL_PERMISSION = StringConstants.ASTERISK;
|
||||
|
||||
/**
|
||||
* 默认密码
|
||||
*/
|
||||
public static final String DEFAULT_PASSWORD = "123456";
|
||||
|
||||
/**
|
||||
* 账号登录 URI
|
||||
*/
|
||||
@@ -69,4 +60,7 @@ public class SysConstants {
|
||||
* 描述类字段后缀
|
||||
*/
|
||||
public static final String DESCRIPTION_FIELD_SUFFIX = "String";
|
||||
|
||||
private SysConstants() {
|
||||
}
|
||||
}
|
||||
|
@@ -16,17 +16,13 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* UI 相关常量
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/9/17 14:12
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class UIConstants {
|
||||
public class UiConstants {
|
||||
|
||||
/**
|
||||
* 主色(极致蓝)
|
||||
@@ -52,4 +48,7 @@ public class UIConstants {
|
||||
* 默认色(中性灰)
|
||||
*/
|
||||
public static final String COLOR_DEFAULT = "gray";
|
||||
|
||||
private UiConstants() {
|
||||
}
|
||||
}
|
@@ -19,7 +19,7 @@ package top.charles7c.continew.admin.common.enums;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.UIConstants;
|
||||
import top.charles7c.continew.admin.common.constant.UiConstants;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
|
||||
/**
|
||||
@@ -33,10 +33,10 @@ import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
public enum DisEnableStatusEnum implements IBaseEnum<Integer> {
|
||||
|
||||
/** 启用 */
|
||||
ENABLE(1, "启用", UIConstants.COLOR_SUCCESS),
|
||||
ENABLE(1, "启用", UiConstants.COLOR_SUCCESS),
|
||||
|
||||
/** 禁用 */
|
||||
DISABLE(2, "禁用", UIConstants.COLOR_ERROR),;
|
||||
DISABLE(2, "禁用", UiConstants.COLOR_ERROR),;
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
@@ -19,7 +19,7 @@ package top.charles7c.continew.admin.common.enums;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.UIConstants;
|
||||
import top.charles7c.continew.admin.common.constant.UiConstants;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
public enum MessageTypeEnum implements IBaseEnum<Integer> {
|
||||
|
||||
/** 系统消息 */
|
||||
SYSTEM(1, "系统消息", UIConstants.COLOR_PRIMARY),;
|
||||
SYSTEM(1, "系统消息", UiConstants.COLOR_PRIMARY),;
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
@@ -19,7 +19,7 @@ package top.charles7c.continew.admin.common.enums;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.UIConstants;
|
||||
import top.charles7c.continew.admin.common.constant.UiConstants;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
|
||||
/**
|
||||
@@ -33,10 +33,10 @@ import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
public enum SuccessFailureStatusEnum implements IBaseEnum<Integer> {
|
||||
|
||||
/** 成功 */
|
||||
SUCCESS(1, "成功", UIConstants.COLOR_SUCCESS),
|
||||
SUCCESS(1, "成功", UiConstants.COLOR_SUCCESS),
|
||||
|
||||
/** 失败 */
|
||||
FAILURE(2, "失败", UIConstants.COLOR_ERROR),;
|
||||
FAILURE(2, "失败", UiConstants.COLOR_ERROR),;
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
@@ -16,13 +16,9 @@
|
||||
|
||||
package top.charles7c.continew.admin.common.util;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
|
||||
import top.charles7c.continew.admin.common.config.properties.RsaProperties;
|
||||
import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
|
||||
|
||||
@@ -32,9 +28,11 @@ import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
|
||||
* @author Charles7c
|
||||
* @since 2022/12/21 21:41
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class SecureUtils {
|
||||
|
||||
private SecureUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥加密
|
||||
*
|
||||
@@ -68,15 +66,4 @@ public class SecureUtils {
|
||||
public static String decryptByRsaPrivateKey(String data, String privateKey) {
|
||||
return new String(SecureUtil.rsa(privateKey, null).decrypt(Base64.decode(data), KeyType.PrivateKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* MD5 加密
|
||||
*
|
||||
* @param data 要加密的内容
|
||||
* @param salt 盐
|
||||
* @return 加密后的内容
|
||||
*/
|
||||
public static String md5Salt(String data, String salt) {
|
||||
return SecureUtil.md5(SecureUtil.md5(data) + salt);
|
||||
}
|
||||
}
|
||||
|
@@ -17,19 +17,18 @@
|
||||
package top.charles7c.continew.admin.common.util.helper;
|
||||
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.session.SaSession;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.JakartaServletUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import top.charles7c.continew.admin.common.constant.CacheConstants;
|
||||
import top.charles7c.continew.admin.common.model.dto.LoginUser;
|
||||
import top.charles7c.continew.starter.core.util.ExceptionUtils;
|
||||
import top.charles7c.continew.starter.core.util.IpUtils;
|
||||
import top.charles7c.continew.starter.extension.crud.base.CommonUserService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.CommonUserService;
|
||||
import top.charles7c.continew.starter.web.util.ServletUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -41,9 +40,11 @@ import java.time.LocalDateTime;
|
||||
* @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
|
||||
* @since 2022/12/24 12:58
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class LoginHelper {
|
||||
|
||||
private LoginHelper() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录并缓存用户信息
|
||||
*
|
||||
@@ -70,17 +71,16 @@ public class LoginHelper {
|
||||
/**
|
||||
* 获取登录用户信息
|
||||
*
|
||||
* @return 登录用户信息(获取 TokenSession 时如未登录,会抛出异常)
|
||||
* @return 登录用户信息
|
||||
* @throws NotLoginException 未登录异常
|
||||
*/
|
||||
public static LoginUser getLoginUser() {
|
||||
public static LoginUser getLoginUser() throws NotLoginException {
|
||||
StpUtil.checkLogin();
|
||||
LoginUser loginUser = (LoginUser)SaHolder.getStorage().get(CacheConstants.LOGIN_USER_KEY);
|
||||
if (null != loginUser) {
|
||||
return loginUser;
|
||||
}
|
||||
SaSession tokenSession = StpUtil.getTokenSession();
|
||||
if (null == tokenSession) {
|
||||
return null;
|
||||
}
|
||||
loginUser = (LoginUser)tokenSession.get(CacheConstants.LOGIN_USER_KEY);
|
||||
SaHolder.getStorage().set(CacheConstants.LOGIN_USER_KEY, loginUser);
|
||||
return loginUser;
|
||||
@@ -106,7 +106,7 @@ public class LoginHelper {
|
||||
* @return 登录用户 ID
|
||||
*/
|
||||
public static Long getUserId() {
|
||||
return ExceptionUtils.exToNull(() -> getLoginUser().getId());
|
||||
return getLoginUser().getId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ public class LoginHelper {
|
||||
* @return 登录用户名
|
||||
*/
|
||||
public static String getUsername() {
|
||||
return ExceptionUtils.exToNull(() -> getLoginUser().getUsername());
|
||||
return getLoginUser().getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,6 +23,7 @@ import top.charles7c.continew.admin.monitor.mapper.LogMapper;
|
||||
import top.charles7c.continew.admin.system.service.UserService;
|
||||
import top.charles7c.continew.starter.log.common.dao.LogDao;
|
||||
import top.charles7c.continew.starter.log.httptracepro.autoconfigure.ConditionalOnEnabledLog;
|
||||
import top.charles7c.continew.starter.web.autoconfigure.trace.TraceProperties;
|
||||
|
||||
/**
|
||||
* 日志配置
|
||||
@@ -38,7 +39,7 @@ public class LogConfiguration {
|
||||
* 日志持久层接口本地实现类
|
||||
*/
|
||||
@Bean
|
||||
public LogDao logDao(UserService userService, LogMapper logMapper) {
|
||||
return new LogDaoLocalImpl(userService, logMapper);
|
||||
public LogDao logDao(UserService userService, LogMapper logMapper, TraceProperties traceProperties) {
|
||||
return new LogDaoLocalImpl(userService, logMapper, traceProperties);
|
||||
}
|
||||
}
|
||||
|
@@ -33,12 +33,13 @@ import top.charles7c.continew.admin.monitor.mapper.LogMapper;
|
||||
import top.charles7c.continew.admin.monitor.model.entity.LogDO;
|
||||
import top.charles7c.continew.admin.system.service.UserService;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
import top.charles7c.continew.starter.web.model.R;
|
||||
import top.charles7c.continew.starter.core.util.ExceptionUtils;
|
||||
import top.charles7c.continew.starter.log.common.dao.LogDao;
|
||||
import top.charles7c.continew.starter.log.common.model.LogRecord;
|
||||
import top.charles7c.continew.starter.log.common.model.LogRequest;
|
||||
import top.charles7c.continew.starter.log.common.model.LogResponse;
|
||||
import top.charles7c.continew.starter.web.autoconfigure.trace.TraceProperties;
|
||||
import top.charles7c.continew.starter.web.model.R;
|
||||
|
||||
import java.net.URI;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -56,6 +57,7 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
|
||||
private final UserService userService;
|
||||
private final LogMapper logMapper;
|
||||
private final TraceProperties traceProperties;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
@@ -86,7 +88,9 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
LogResponse logResponse = logRecord.getResponse();
|
||||
Integer statusCode = logResponse.getStatus();
|
||||
logDO.setStatusCode(statusCode);
|
||||
logDO.setResponseHeaders(JSONUtil.toJsonStr(logResponse.getHeaders()));
|
||||
Map<String, String> responseHeaders = logResponse.getHeaders();
|
||||
logDO.setResponseHeaders(JSONUtil.toJsonStr(responseHeaders));
|
||||
logDO.setTraceId(responseHeaders.get(traceProperties.getHeaderName()));
|
||||
String responseBody = logResponse.getBody();
|
||||
logDO.setResponseBody(responseBody);
|
||||
// 状态
|
||||
|
@@ -16,17 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.monitor.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.monitor.enums.LogStatusEnum;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.admin.monitor.enums.LogStatusEnum;
|
||||
|
||||
/**
|
||||
* 系统日志实体
|
||||
*
|
||||
@@ -46,6 +44,11 @@ public class LogDO implements Serializable {
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 链路 ID
|
||||
*/
|
||||
private String traceId;
|
||||
|
||||
/**
|
||||
* 日志描述
|
||||
*/
|
||||
|
@@ -16,22 +16,18 @@
|
||||
|
||||
package top.charles7c.continew.admin.monitor.model.query;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
/**
|
||||
* 登录日志查询条件
|
||||
*
|
||||
@@ -49,7 +45,6 @@ public class LoginLogQuery implements Serializable {
|
||||
* 登录状态
|
||||
*/
|
||||
@Schema(description = "登录状态(1:成功;2:失败)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
|
@@ -16,22 +16,18 @@
|
||||
|
||||
package top.charles7c.continew.admin.monitor.model.query;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
/**
|
||||
* 操作日志查询条件
|
||||
*
|
||||
@@ -49,14 +45,13 @@ public class OperationLogQuery implements Serializable {
|
||||
* 操作内容
|
||||
*/
|
||||
@Schema(description = "操作内容", example = "新增数据")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 操作状态
|
||||
*/
|
||||
@Schema(description = "操作状态(1:成功;2:失败)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
@@ -71,6 +66,6 @@ public class OperationLogQuery implements Serializable {
|
||||
* 操作人
|
||||
*/
|
||||
@Schema(description = "操作人", example = "张三")
|
||||
@Query(property = "createUser")
|
||||
@Query(columns = "create_user")
|
||||
private Long uid;
|
||||
}
|
||||
|
@@ -16,22 +16,18 @@
|
||||
|
||||
package top.charles7c.continew.admin.monitor.model.query;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
/**
|
||||
* 系统日志查询条件
|
||||
*
|
||||
@@ -45,6 +41,12 @@ public class SystemLogQuery implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 链路 ID
|
||||
*/
|
||||
@Schema(description = "链路 ID", example = "904846526308876288")
|
||||
private String traceId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
@@ -16,11 +16,10 @@
|
||||
|
||||
package top.charles7c.continew.admin.monitor.model.resp;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 系统日志详情信息
|
||||
@@ -35,6 +34,12 @@ public class SystemLogDetailResp extends LogResp {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 链路 ID
|
||||
*/
|
||||
@Schema(description = "链路 ID", example = "904846526308876288")
|
||||
private String traceId;
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
|
@@ -79,6 +79,7 @@ public interface LogService {
|
||||
/**
|
||||
* 查询仪表盘访问趋势信息
|
||||
*
|
||||
* @param days 日期数
|
||||
* @return 仪表盘访问趋势信息
|
||||
*/
|
||||
List<DashboardAccessTrendResp> listDashboardAccessTrend(Integer days);
|
||||
|
@@ -34,13 +34,12 @@ import top.charles7c.continew.admin.monitor.model.resp.*;
|
||||
import top.charles7c.continew.admin.monitor.service.LogService;
|
||||
import top.charles7c.continew.starter.core.util.ReflectUtils;
|
||||
import top.charles7c.continew.starter.core.util.validate.CheckUtils;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryHelper;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryWrapperHelper;
|
||||
import top.charles7c.continew.starter.extension.crud.model.query.PageQuery;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.PageResp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 系统日志业务实现
|
||||
@@ -58,13 +57,13 @@ public class LogServiceImpl implements LogService {
|
||||
@Override
|
||||
@AutoOperate(type = OperationLogResp.class, on = "list")
|
||||
public PageResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
QueryWrapper<LogDO> queryWrapper = QueryWrapperHelper.build(query);
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(OperationLogResp.class);
|
||||
List<String> columnNameList = fieldNameList.stream()
|
||||
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
queryWrapper.select(columnNameList);
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
@@ -74,14 +73,14 @@ public class LogServiceImpl implements LogService {
|
||||
@Override
|
||||
@AutoOperate(type = LoginLogResp.class, on = "list")
|
||||
public PageResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
QueryWrapper<LogDO> queryWrapper = QueryWrapperHelper.build(query);
|
||||
queryWrapper.eq("module", "登录");
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(LoginLogResp.class);
|
||||
List<String> columnNameList = fieldNameList.stream()
|
||||
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
queryWrapper.select(columnNameList);
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
@@ -91,13 +90,13 @@ public class LogServiceImpl implements LogService {
|
||||
@Override
|
||||
@AutoOperate(type = SystemLogResp.class, on = "list")
|
||||
public PageResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
QueryWrapper<LogDO> queryWrapper = QueryWrapperHelper.build(query);
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(SystemLogResp.class);
|
||||
List<String> columnNameList = fieldNameList.stream()
|
||||
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
queryWrapper.select(columnNameList);
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
|
@@ -14,15 +14,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.continew.admin.common.config;
|
||||
package top.charles7c.continew.admin.auth.config.satoken;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Crane4j 配置
|
||||
* Sa-Token 配置
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2024/1/11 21:22
|
||||
* @since 2022/12/19 22:13
|
||||
*/
|
||||
@Configuration
|
||||
public class Crane4jConfiguration extends cn.crane4j.spring.boot.config.Crane4jAutoConfiguration {}
|
||||
public class SaTokenConfiguration {
|
||||
|
||||
/**
|
||||
* Sa-Token 权限认证配置
|
||||
*/
|
||||
@Bean
|
||||
public StpInterface stpInterface() {
|
||||
return new SaTokenPermissionImpl();
|
||||
}
|
||||
}
|
@@ -16,35 +16,27 @@
|
||||
|
||||
package top.charles7c.continew.admin.auth.config.satoken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
|
||||
import top.charles7c.continew.admin.common.model.dto.LoginUser;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Sa-Token 权限认证适配
|
||||
* Sa-Token 权限认证实现
|
||||
*
|
||||
* @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
|
||||
* @author Charles7c
|
||||
* @since 2023/3/1 22:28
|
||||
*/
|
||||
public class SaTokenPermissionImpl implements StpInterface {
|
||||
|
||||
/**
|
||||
* 获取菜单权限列表
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
return new ArrayList<>(loginUser.getPermissions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色权限列表
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
|
@@ -16,19 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.auth.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 邮箱登录信息
|
||||
@@ -48,7 +44,7 @@ public class EmailLoginReq implements Serializable {
|
||||
*/
|
||||
@Schema(description = "邮箱", example = "123456789@qq.com")
|
||||
@NotBlank(message = "邮箱不能为空")
|
||||
@Pattern(regexp = RegexConstants.EMAIL, message = "邮箱格式错误")
|
||||
@Pattern(regexp = RegexPool.EMAIL, message = "邮箱格式错误")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
|
@@ -16,19 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.auth.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 手机号登录信息
|
||||
@@ -48,7 +44,7 @@ public class PhoneLoginReq implements Serializable {
|
||||
*/
|
||||
@Schema(description = "手机号", example = "13811111111")
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@Pattern(regexp = RegexConstants.MOBILE, message = "手机号格式错误")
|
||||
@Pattern(regexp = RegexPool.MOBILE, message = "手机号格式错误")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
|
@@ -16,22 +16,19 @@
|
||||
|
||||
package top.charles7c.continew.admin.auth.model.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.starter.security.mask.annotation.JsonMask;
|
||||
import top.charles7c.continew.starter.security.mask.enums.MaskType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
@@ -72,13 +69,15 @@ public class UserInfoResp implements Serializable {
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱", example = "123456789@qq.com")
|
||||
@Schema(description = "邮箱", example = "c*******@126.com")
|
||||
@JsonMask(MaskType.EMAIL)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Schema(description = "手机号码", example = "13811111111")
|
||||
@Schema(description = "手机号码", example = "188****8888")
|
||||
@JsonMask(MaskType.MOBILE_PHONE)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
@@ -135,14 +134,6 @@ public class UserInfoResp implements Serializable {
|
||||
@Schema(description = "角色编码集合", example = "[\"test\"]")
|
||||
private Set<String> roles;
|
||||
|
||||
public String getEmail() {
|
||||
return DesensitizedUtil.email(email);
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return DesensitizedUtil.mobilePhone(phone);
|
||||
}
|
||||
|
||||
public LocalDate getRegistrationDate() {
|
||||
return createTime.toLocalDate();
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhyd.oauth.model.AuthUser;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import top.charles7c.continew.admin.auth.model.resp.MetaResp;
|
||||
import top.charles7c.continew.admin.auth.model.resp.RouteResp;
|
||||
@@ -39,7 +40,6 @@ import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.admin.common.enums.MenuTypeEnum;
|
||||
import top.charles7c.continew.admin.common.enums.MessageTypeEnum;
|
||||
import top.charles7c.continew.admin.common.model.dto.LoginUser;
|
||||
import top.charles7c.continew.admin.common.util.SecureUtils;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.admin.system.enums.MessageTemplateEnum;
|
||||
import top.charles7c.continew.admin.system.model.entity.DeptDO;
|
||||
@@ -56,7 +56,6 @@ import top.charles7c.continew.starter.extension.crud.util.TreeUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 登录业务实现
|
||||
@@ -77,13 +76,13 @@ public class LoginServiceImpl implements LoginService {
|
||||
private final UserRoleService userRoleService;
|
||||
private final UserSocialService userSocialService;
|
||||
private final MessageService messageService;
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public String accountLogin(String username, String password) {
|
||||
UserDO user = userService.getByUsername(username);
|
||||
CheckUtils.throwIfNull(user, "用户名或密码不正确");
|
||||
Long userId = user.getId();
|
||||
CheckUtils.throwIfNotEqual(SecureUtils.md5Salt(password, userId.toString()), user.getPassword(), "用户名或密码不正确");
|
||||
CheckUtils.throwIf(!passwordEncoder.matches(password, user.getPassword()), "用户名或密码不正确");
|
||||
this.checkUserStatus(user);
|
||||
return this.login(user);
|
||||
}
|
||||
@@ -158,9 +157,7 @@ public class LoginServiceImpl implements LoginService {
|
||||
} else {
|
||||
roleCodeSet.forEach(roleCode -> menuSet.addAll(menuService.listByRoleCode(roleCode)));
|
||||
}
|
||||
List<MenuResp> menuList = menuSet.stream()
|
||||
.filter(m -> !MenuTypeEnum.BUTTON.equals(m.getType()))
|
||||
.collect(Collectors.toList());
|
||||
List<MenuResp> menuList = menuSet.stream().filter(m -> !MenuTypeEnum.BUTTON.equals(m.getType())).toList();
|
||||
// 构建路由树
|
||||
TreeField treeField = MenuResp.class.getDeclaredAnnotation(TreeField.class);
|
||||
TreeNodeConfig treeNodeConfig = TreeUtils.genTreeNodeConfig(treeField);
|
||||
@@ -175,7 +172,7 @@ public class LoginServiceImpl implements LoginService {
|
||||
MetaResp metaResp = new MetaResp();
|
||||
metaResp.setLocale(m.getTitle());
|
||||
metaResp.setIcon(m.getIcon());
|
||||
metaResp.setIgnoreCache(!m.getIsCache());
|
||||
metaResp.setIgnoreCache(Boolean.FALSE.equals(m.getIsCache()));
|
||||
metaResp.setHideInMenu(m.getIsHidden());
|
||||
metaResp.setOrder(m.getSort());
|
||||
tree.putExtra("meta", metaResp);
|
||||
|
@@ -16,19 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.config;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.recorder.FileRecorder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.EscapeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.recorder.FileRecorder;
|
||||
import org.dromara.x.file.storage.core.upload.FilePartInfo;
|
||||
import org.springframework.stereotype.Component;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.admin.system.enums.FileTypeEnum;
|
||||
import top.charles7c.continew.admin.system.mapper.FileMapper;
|
||||
@@ -37,6 +33,8 @@ import top.charles7c.continew.admin.system.model.entity.FileDO;
|
||||
import top.charles7c.continew.admin.system.model.entity.StorageDO;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 文件记录实现类
|
||||
*
|
||||
@@ -100,4 +98,16 @@ public class FileRecorderImpl implements FileRecorder {
|
||||
.oneOpt()
|
||||
.orElse(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(FileInfo fileInfo) {
|
||||
/* 不使用分片功能则无需重写 */ }
|
||||
|
||||
@Override
|
||||
public void saveFilePart(FilePartInfo filePartInfo) {
|
||||
/* 不使用分片功能则无需重写 */ }
|
||||
|
||||
@Override
|
||||
public void deleteFilePartByUploadId(String s) {
|
||||
/* 不使用分片功能则无需重写 */}
|
||||
}
|
@@ -19,7 +19,7 @@ package top.charles7c.continew.admin.system.enums;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.UIConstants;
|
||||
import top.charles7c.continew.admin.common.constant.UiConstants;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
|
||||
/**
|
||||
@@ -33,13 +33,13 @@ import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||
public enum AnnouncementStatusEnum implements IBaseEnum<Integer> {
|
||||
|
||||
/** 待发布 */
|
||||
PENDING_RELEASE(1, "待发布", UIConstants.COLOR_PRIMARY),
|
||||
PENDING_RELEASE(1, "待发布", UiConstants.COLOR_PRIMARY),
|
||||
|
||||
/** 已发布 */
|
||||
PUBLISHED(2, "已发布", UIConstants.COLOR_SUCCESS),
|
||||
PUBLISHED(2, "已发布", UiConstants.COLOR_SUCCESS),
|
||||
|
||||
/** 已过期 */
|
||||
EXPIRED(3, "已过期", UIConstants.COLOR_ERROR),;
|
||||
EXPIRED(3, "已过期", UiConstants.COLOR_ERROR),;
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
@@ -16,14 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import top.charles7c.continew.admin.common.model.resp.LabelValueResp;
|
||||
import top.charles7c.continew.admin.system.model.entity.DictItemDO;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.base.BaseMapper;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典项 Mapper
|
||||
*
|
||||
@@ -38,5 +38,5 @@ public interface DictItemMapper extends BaseMapper<DictItemDO> {
|
||||
* @param dictCode 字典编码
|
||||
* @return 字典项列表
|
||||
*/
|
||||
List<LabelValueResp> listByDictCode(@Param("dictCode") String dictCode);
|
||||
List<LabelValueResp<Serializable>> listByDictCode(@Param("dictCode") String dictCode);
|
||||
}
|
@@ -21,6 +21,7 @@ import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import top.charles7c.continew.admin.common.config.mybatis.DataPermissionMapper;
|
||||
import top.charles7c.continew.admin.system.model.entity.UserDO;
|
||||
import top.charles7c.continew.starter.security.crypto.annotation.FieldEncrypt;
|
||||
|
||||
/**
|
||||
* 用户 Mapper
|
||||
@@ -46,7 +47,7 @@ public interface UserMapper extends DataPermissionMapper<UserDO> {
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Select("SELECT * FROM `sys_user` WHERE `phone` = #{phone}")
|
||||
UserDO selectByPhone(@Param("phone") String phone);
|
||||
UserDO selectByPhone(@FieldEncrypt @Param("phone") String phone);
|
||||
|
||||
/**
|
||||
* 根据邮箱查询
|
||||
@@ -55,7 +56,7 @@ public interface UserMapper extends DataPermissionMapper<UserDO> {
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Select("SELECT * FROM `sys_user` WHERE `email` = #{email}")
|
||||
UserDO selectByEmail(@Param("email") String email);
|
||||
UserDO selectByEmail(@FieldEncrypt @Param("email") String email);
|
||||
|
||||
/**
|
||||
* 根据 ID 查询昵称
|
||||
|
@@ -23,7 +23,7 @@ import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 公告实体
|
||||
|
@@ -23,7 +23,7 @@ import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 部门实体
|
||||
|
@@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 字典实体
|
||||
|
@@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 字典项实体
|
||||
|
@@ -29,7 +29,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import top.charles7c.continew.admin.system.enums.FileTypeEnum;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
import top.charles7c.continew.starter.core.util.URLUtils;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 文件实体
|
||||
|
@@ -24,7 +24,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.MenuTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 菜单实体
|
||||
|
@@ -16,12 +16,12 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息和用户关联实体
|
||||
@@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@TableName("sys_message_user")
|
||||
public class MessageUserDO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 角色实体
|
||||
|
@@ -24,7 +24,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.system.enums.StorageTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
|
||||
/**
|
||||
* 存储库实体
|
||||
|
@@ -16,16 +16,16 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.entity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.config.mybatis.BCryptEncryptor;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDO;
|
||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||
import top.charles7c.continew.starter.security.crypto.annotation.FieldEncrypt;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户实体
|
||||
@@ -53,6 +53,7 @@ public class UserDO extends BaseDO {
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@FieldEncrypt(encryptor = BCryptEncryptor.class)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
@@ -63,11 +64,13 @@ public class UserDO extends BaseDO {
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@FieldEncrypt
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@FieldEncrypt
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
|
@@ -16,16 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 公告查询条件
|
||||
*
|
||||
@@ -43,13 +41,12 @@ public class AnnouncementQuery implements Serializable {
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题", example = "这是公告标题")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description = "类型", example = "1")
|
||||
@Query(type = QueryType.EQUAL)
|
||||
private String type;
|
||||
}
|
@@ -16,16 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 部门查询条件
|
||||
*
|
||||
@@ -43,13 +41,12 @@ public class DeptQuery implements Serializable {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称", example = "测试部")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态(1:启用;2:禁用)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
}
|
||||
|
@@ -16,14 +16,11 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 字典项查询条件
|
||||
@@ -42,6 +39,5 @@ public class DictItemQuery implements Serializable {
|
||||
* 字典 ID
|
||||
*/
|
||||
@Schema(description = "字典 ID")
|
||||
@Query
|
||||
private Long dictId;
|
||||
}
|
@@ -16,15 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
|
||||
/**
|
||||
* 字典查询条件
|
||||
*
|
||||
@@ -42,7 +41,7 @@ public class DictQuery implements Serializable {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
@Query(blurry = {"code", "name", "description"})
|
||||
@Query(columns = {"name", "code", "description"}, type = QueryType.LIKE)
|
||||
private String name;
|
||||
|
||||
}
|
@@ -16,16 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 文件查询条件
|
||||
*
|
||||
@@ -43,13 +41,12 @@ public class FileQuery implements Serializable {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description = "类型")
|
||||
@Query(type = QueryType.EQUAL)
|
||||
private Integer type;
|
||||
}
|
@@ -16,16 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 菜单查询条件
|
||||
*
|
||||
@@ -43,13 +41,12 @@ public class MenuQuery implements Serializable {
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题", example = "用户管理")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态(1:启用;2:禁用)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
}
|
||||
|
@@ -16,15 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryIgnore;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息查询条件
|
||||
*
|
||||
@@ -35,38 +35,39 @@ import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
@Schema(description = "消息查询条件")
|
||||
public class MessageQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID", example = "1")
|
||||
@Query
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题", example = "欢迎注册 xxx")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description = "类型(1:系统消息)", example = "1")
|
||||
@Query
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 是否已读
|
||||
*/
|
||||
@Schema(description = "是否已读", example = "true")
|
||||
@QueryIgnore
|
||||
private Boolean isRead;
|
||||
|
||||
/**
|
||||
* 用户 ID
|
||||
*/
|
||||
@Schema(hidden = true)
|
||||
@QueryIgnore
|
||||
private Long userId;
|
||||
}
|
@@ -16,15 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
|
||||
/**
|
||||
* 角色查询条件
|
||||
*
|
||||
@@ -42,13 +41,12 @@ public class RoleQuery implements Serializable {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称", example = "测试人员")
|
||||
@Query(blurry = {"name", "code"})
|
||||
@Query(columns = {"name", "code"}, type = QueryType.LIKE)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态(1:启用;2:禁用)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
}
|
||||
|
@@ -16,16 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 存储库查询条件
|
||||
*
|
||||
@@ -43,13 +41,12 @@ public class StorageQuery implements Serializable {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
@Query(type = QueryType.INNER_LIKE)
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
@Query(type = QueryType.EQUAL)
|
||||
private Integer status;
|
||||
}
|
@@ -16,22 +16,18 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.query;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query;
|
||||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType;
|
||||
|
||||
/**
|
||||
* 用户查询条件
|
||||
*
|
||||
@@ -49,14 +45,13 @@ public class UserQuery implements Serializable {
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名", example = "zhangsan")
|
||||
@Query(blurry = {"username", "nickname", "email", "phone"})
|
||||
@Query(columns = {"username", "nickname"}, type = QueryType.LIKE)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态(1:启用;2:禁用)", example = "1")
|
||||
@Query
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
@@ -71,6 +66,5 @@ public class UserQuery implements Serializable {
|
||||
* 部门 ID
|
||||
*/
|
||||
@Schema(description = "部门 ID", example = "1")
|
||||
@Query
|
||||
private Long deptId;
|
||||
}
|
||||
|
@@ -16,19 +16,16 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Future;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改公告信息
|
||||
*
|
||||
|
@@ -16,23 +16,19 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.base.ValidateGroup;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.util.ValidateGroup;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 创建或修改部门信息
|
||||
|
@@ -26,7 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改字典项信息
|
||||
|
@@ -16,18 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 创建或修改字典信息
|
||||
|
@@ -26,7 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 修改文件信息
|
||||
|
@@ -30,7 +30,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.MenuTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改菜单信息
|
||||
|
@@ -28,7 +28,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.MessageTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建消息信息
|
||||
|
@@ -26,7 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 修改参数信息
|
||||
|
@@ -33,7 +33,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import top.charles7c.continew.admin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改角色信息
|
||||
|
@@ -29,7 +29,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.system.enums.StorageTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改存储库信息
|
||||
|
@@ -16,19 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户邮箱修改信息
|
||||
@@ -48,7 +44,7 @@ public class UserEmailUpdateRequest implements Serializable {
|
||||
*/
|
||||
@Schema(description = "新邮箱", example = "123456789@qq.com")
|
||||
@NotBlank(message = "新邮箱不能为空")
|
||||
@Pattern(regexp = RegexConstants.EMAIL, message = "邮箱格式错误")
|
||||
@Pattern(regexp = RegexPool.EMAIL, message = "邮箱格式错误")
|
||||
private String newEmail;
|
||||
|
||||
/**
|
||||
@@ -60,9 +56,9 @@ public class UserEmailUpdateRequest implements Serializable {
|
||||
private String captcha;
|
||||
|
||||
/**
|
||||
* 当前密码(加密后)
|
||||
* 当前密码(加密)
|
||||
*/
|
||||
@Schema(description = "当前密码(加密后)", example = "SYRLSszQGcMv4kP2Yolou9zf28B9GDakR9u91khxmR7V++i5A384kwnNZxqgvT6bjT4zqpIDuMFLWSt92hQJJA==")
|
||||
@Schema(description = "当前密码(加密)", example = "SYRLSszQGcMv4kP2Yolou9zf28B9GDakR9u91khxmR7V++i5A384kwnNZxqgvT6bjT4zqpIDuMFLWSt92hQJJA==")
|
||||
@NotBlank(message = "当前密码不能为空")
|
||||
private String currentPassword;
|
||||
}
|
||||
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户密码重置信息
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2024/2/2 22:50
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户密码重置信息")
|
||||
public class UserPasswordResetReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 新密码(加密)
|
||||
*/
|
||||
@Schema(description = "新密码(加密)", example = "Gzc78825P5baH190lRuZFb9KJxRt/psN2jiyOMPoc5WRcCvneCwqDm3Q33BZY56EzyyVy7vQu7jQwYTK4j1+5w==")
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
private String newPassword;
|
||||
}
|
@@ -16,14 +16,12 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户密码修改信息
|
||||
@@ -39,15 +37,15 @@ public class UserPasswordUpdateReq implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 当前密码(加密后)
|
||||
* 当前密码(加密)
|
||||
*/
|
||||
@Schema(description = "当前密码(加密后)", example = "E7c72TH+LDxKTwavjM99W1MdI9Lljh79aPKiv3XB9MXcplhm7qJ1BJCj28yaflbdVbfc366klMtjLIWQGqb0qw==")
|
||||
@Schema(description = "当前密码(加密)", example = "E7c72TH+LDxKTwavjM99W1MdI9Lljh79aPKiv3XB9MXcplhm7qJ1BJCj28yaflbdVbfc366klMtjLIWQGqb0qw==")
|
||||
private String oldPassword;
|
||||
|
||||
/**
|
||||
* 新密码(加密后)
|
||||
* 新密码(加密)
|
||||
*/
|
||||
@Schema(description = "新密码(加密后)", example = "Gzc78825P5baH190lRuZFb9KJxRt/psN2jiyOMPoc5WRcCvneCwqDm3Q33BZY56EzyyVy7vQu7jQwYTK4j1+5w==")
|
||||
@Schema(description = "新密码(加密)", example = "Gzc78825P5baH190lRuZFb9KJxRt/psN2jiyOMPoc5WRcCvneCwqDm3Q33BZY56EzyyVy7vQu7jQwYTK4j1+5w==")
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
private String newPassword;
|
||||
}
|
||||
|
@@ -16,19 +16,15 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户手机号修改信息
|
||||
@@ -48,7 +44,7 @@ public class UserPhoneUpdateReq implements Serializable {
|
||||
*/
|
||||
@Schema(description = "新手机号", example = "13811111111")
|
||||
@NotBlank(message = "新手机号不能为空")
|
||||
@Pattern(regexp = RegexConstants.MOBILE, message = "手机号格式错误")
|
||||
@Pattern(regexp = RegexPool.MOBILE, message = "手机号格式错误")
|
||||
private String newPhone;
|
||||
|
||||
/**
|
||||
@@ -60,9 +56,9 @@ public class UserPhoneUpdateReq implements Serializable {
|
||||
private String captcha;
|
||||
|
||||
/**
|
||||
* 当前密码(加密后)
|
||||
* 当前密码(加密)
|
||||
*/
|
||||
@Schema(description = "当前密码(加密后)", example = "SYRLSszQGcMv4kP2Yolou9zf28B9GDakR9u91khxmR7V++i5A384kwnNZxqgvT6bjT4zqpIDuMFLWSt92hQJJA==")
|
||||
@Schema(description = "当前密码(加密)", example = "SYRLSszQGcMv4kP2Yolou9zf28B9GDakR9u91khxmR7V++i5A384kwnNZxqgvT6bjT4zqpIDuMFLWSt92hQJJA==")
|
||||
@NotBlank(message = "当前密码不能为空")
|
||||
private String currentPassword;
|
||||
}
|
||||
|
@@ -16,24 +16,22 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.req;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.RegexPool;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.continew.admin.common.constant.RegexConstants;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.model.req.BaseReq;
|
||||
import top.charles7c.continew.starter.extension.crud.util.ValidateGroup;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建或修改用户信息
|
||||
@@ -64,11 +62,18 @@ public class UserReq extends BaseReq {
|
||||
@Pattern(regexp = RegexConstants.GENERAL_NAME, message = "昵称长度为 2 到 30 位,可以包含中文、字母、数字、下划线,短横线")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 密码(加密)
|
||||
*/
|
||||
@Schema(description = "密码(加密)", example = "E7c72TH+LDxKTwavjM99W1MdI9Lljh79aPKiv3XB9MXcplhm7qJ1BJCj28yaflbdVbfc366klMtjLIWQGqb0qw==")
|
||||
@NotBlank(message = "密码不能为空", groups = ValidateGroup.Crud.Add.class)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱", example = "123456789@qq.com")
|
||||
@Pattern(regexp = "^$|" + RegexConstants.EMAIL, message = "邮箱格式错误")
|
||||
@Pattern(regexp = "^$|" + RegexPool.EMAIL, message = "邮箱格式错误")
|
||||
@Length(max = 255, message = "邮箱长度不能超过 {max} 个字符")
|
||||
private String email;
|
||||
|
||||
@@ -76,7 +81,7 @@ public class UserReq extends BaseReq {
|
||||
* 手机号码
|
||||
*/
|
||||
@Schema(description = "手机号码", example = "13811111111")
|
||||
@Pattern(regexp = "^$|" + RegexConstants.MOBILE, message = "手机号码格式错误")
|
||||
@Pattern(regexp = "^$|" + RegexPool.MOBILE, message = "手机号码格式错误")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
|
@@ -16,17 +16,14 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.resp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 公告详情信息
|
||||
|
@@ -24,7 +24,7 @@ import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.admin.system.enums.AnnouncementStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 公告信息
|
||||
|
@@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.system.service.DeptService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.converter.ExcelBaseEnumConverter;
|
||||
|
||||
import java.io.Serial;
|
||||
|
@@ -16,15 +16,13 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.resp;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.annotation.TreeField;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
|
@@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 字典详情信息
|
||||
|
@@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 字典项详情信息
|
||||
|
@@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 字典项信息
|
||||
|
@@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 字典信息
|
||||
|
@@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
|
||||
import top.charles7c.continew.admin.system.enums.FileTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
|
@@ -29,7 +29,7 @@ import top.charles7c.continew.starter.extension.crud.converter.ExcelBaseEnumConv
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.MenuTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.annotation.TreeField;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
|
@@ -25,7 +25,7 @@ import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.constant.ContainerConstants;
|
||||
import top.charles7c.continew.admin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.converter.ExcelBaseEnumConverter;
|
||||
|
||||
import java.io.Serial;
|
||||
|
@@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
|
@@ -28,7 +28,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import top.charles7c.continew.starter.extension.crud.converter.ExcelBaseEnumConverter;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.system.enums.StorageTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 存储库详情信息
|
||||
|
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.system.enums.StorageTypeEnum;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
|
||||
/**
|
||||
* 存储库信息
|
||||
|
@@ -29,7 +29,7 @@ import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.admin.system.service.DeptService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||
import top.charles7c.continew.starter.extension.crud.converter.ExcelBaseEnumConverter;
|
||||
|
||||
import java.io.Serial;
|
||||
|
@@ -16,19 +16,17 @@
|
||||
|
||||
package top.charles7c.continew.admin.system.model.resp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Objects;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||
import top.charles7c.continew.admin.common.util.helper.LoginHelper;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseResp;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.BaseResp;
|
||||
import top.charles7c.continew.starter.security.mask.annotation.JsonMask;
|
||||
import top.charles7c.continew.starter.security.mask.enums.MaskType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
@@ -70,13 +68,15 @@ public class UserResp extends BaseResp {
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱", example = "123456789@qq.com")
|
||||
@Schema(description = "邮箱", example = "c*******@126.com")
|
||||
@JsonMask(MaskType.EMAIL)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Schema(description = "手机号码", example = "13811111111")
|
||||
@Schema(description = "手机号码", example = "188****8888")
|
||||
@JsonMask(MaskType.MOBILE_PHONE)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
@@ -97,14 +97,6 @@ public class UserResp extends BaseResp {
|
||||
@Schema(description = "描述", example = "张三描述信息")
|
||||
private String description;
|
||||
|
||||
public String getEmail() {
|
||||
return DesensitizedUtil.email(email);
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return DesensitizedUtil.mobilePhone(phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getDisabled() {
|
||||
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
|
||||
|
@@ -22,8 +22,8 @@ import top.charles7c.continew.admin.system.model.req.AnnouncementReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.AnnouncementDetailResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.AnnouncementResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.DashboardAnnouncementResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -21,8 +21,8 @@ import top.charles7c.continew.admin.system.model.query.DeptQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.DeptReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.DeptDetailResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.DeptResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
/**
|
||||
* 部门业务接口
|
||||
|
@@ -22,9 +22,10 @@ import top.charles7c.continew.admin.system.model.query.DictItemQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.DictItemReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.DictItemDetailResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.DictItemResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ public interface DictItemService extends BaseService<DictItemResp, DictItemDetai
|
||||
* @param dictCode 字典编码
|
||||
* @return 字典项列表
|
||||
*/
|
||||
List<LabelValueResp> listByDictCode(String dictCode);
|
||||
List<LabelValueResp<Serializable>> listByDictCode(String dictCode);
|
||||
|
||||
/**
|
||||
* 根据字典 ID 列表删除
|
||||
|
@@ -21,8 +21,8 @@ import top.charles7c.continew.admin.system.model.query.DictQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.DictReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.DictDetailResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.DictResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
/**
|
||||
* 字典业务接口
|
||||
|
@@ -22,8 +22,8 @@ import top.charles7c.continew.admin.system.model.entity.FileDO;
|
||||
import top.charles7c.continew.admin.system.model.query.FileQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.FileReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.FileResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -20,8 +20,8 @@ import top.charles7c.continew.admin.system.model.entity.MenuDO;
|
||||
import top.charles7c.continew.admin.system.model.query.MenuQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.MenuReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.MenuResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -49,11 +49,4 @@ public interface MenuService extends BaseService<MenuResp, MenuResp, MenuQuery,
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<MenuResp> listByRoleCode(String roleCode);
|
||||
|
||||
/**
|
||||
* 查询所有菜单
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<MenuResp> list();
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ import top.charles7c.continew.admin.system.model.query.RoleQuery;
|
||||
import top.charles7c.continew.admin.system.model.req.RoleReq;
|
||||
import top.charles7c.continew.admin.system.model.resp.RoleDetailResp;
|
||||
import top.charles7c.continew.admin.system.model.resp.RoleResp;
|
||||
import top.charles7c.continew.starter.extension.crud.base.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.base.IService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.BaseService;
|
||||
import top.charles7c.continew.starter.extension.crud.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user