diff --git a/.gitignore b/.gitignore
index 574b56e5..29059ede 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,35 +1,35 @@
-.DS_Store
-node_modules/
-dist/
-demo/
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-**/*.log
-
-tests/**/coverage/
-tests/e2e/reports
-selenium-debug.log
-cutejava-doc
-
-# Editor directories and files
-.idea
-.vscode
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.local
-
-package-lock.json
-yarn.lock
-
-### IDEA ###
-.DS_Store
-~/*
-.idea/*
-*.iml
-*/target/*
-*/*.iml
-/.gradle/
+.DS_Store
+node_modules/
+dist/
+demo/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
+cutejava-doc
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+
+package-lock.json
+yarn.lock
+
+### IDEA ###
+.DS_Store
+~/*
+.idea/*
+*.iml
+*/target/*
+*/*.iml
+/.gradle/
/application.pid
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 485efc74..fe57103d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,191 +1,191 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "{}" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright 2022-2025 Odboy
-
- 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
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "{}" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+ Copyright 2022-2025 Odboy
+
+ 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.
\ No newline at end of file
diff --git a/README.MD b/README.MD
index 5dcacd33..1257ae09 100644
--- a/README.MD
+++ b/README.MD
@@ -1,96 +1,96 @@
-
+
+#### 项目简介
+
+一个基于 Spring Boot 2.7.18 、 Mybatis-Plus、 JWT、Spring Security、Redis、Vue2的前后端分离的后台管理系统
+
+**账号密码:** `admin / 123456`
+
+#### 项目源码
+
+https://github.com/odboy-tianjun/cutejava
+
+#### 编码规范
+
+- 和数据库表一一对应的类, 以`Tb`结尾
+- API请求参数类名, 以`Args`结尾
+- API响应参数类名, 以`Vo`结尾
+- 事件驱动类名, 以`Event`结尾
+- 消息队列/Socket传输类名,以`Message`结尾
+- 常用的辅助类的类名, 以`Cs`开头
+- 查询分页、查询列表的方法,一律为同一个方法名
+ - 查询分页:queryUser(args, page)
+ - 查询列表:queryUser(args)
+ - MapperXml:这样mapper.xml文件中的实现方法只需要写一个queryUser
+- 枚举类名,以`Enum`结尾
+- 拒绝过度包装
+
+#### 主要特性
+
+- 使用最新技术栈,社区资源丰富。
+- 高效率开发,代码生成器可一键生成前后端代码
+- 支持数据字典,可方便地对一些状态进行管理
+- 支持接口限流,避免恶意请求导致服务层压力过大
+- 支持接口级别的功能权限与数据权限,可自定义操作
+- 自定义权限注解与匿名接口注解,可快速对接口拦截与放行
+- 对一些常用地前端组件封装:表格数据请求、数据字典等
+- 前后端统一异常拦截处理,统一输出异常,避免繁琐的判断
+- 支持在线用户管理与服务器性能监控,支持限制单用户登录
+- 支持一键复制菜单项,避免菜单繁琐配置
+
+#### 系统功能
+
+- 用户管理:提供用户的相关配置,新增用户后,默认密码为123456
+- 角色管理:对权限与菜单进行分配,可根据部门设置角色的数据权限
+- 菜单管理:已实现菜单动态路由,后端可配置化,支持多级菜单
+- 部门管理:可配置系统组织架构,树形表格展示
+- 岗位管理:配置各个部门的职位
+- 字典管理:可维护常用一些固定的数据,如:状态,性别等
+- SQL监控:采用druid 监控数据库访问性能,默认用户名admin,密码123456
+- 定时任务:整合Quartz做定时任务,加入任务日志,任务运行情况一目了然
+- 邮件工具:配合富文本,发送html格式的邮件
+- 存储管理:本地存储、Minio存储
+- 服务监控:监控服务器的负载情况
+
+#### 前端基础组件
+
+> 组件所在路径:cutejava-front/src/views/components/dev
+
+- CuteSimpleTable 简单表格
+- CuteDragTable 支持拖拽的表格
+- CuteFormDialog 支持表单的对话框
+- CuteFormDrawer 支持表单的抽屉
+- CuteRichTextEditor 富文本编辑器
+- CuteOneKeyCopy 一键复制
+- CuteMarkdown Markdown编辑器
+- CuteJavaEditor Java编辑器(已弃用)
+- CuteYamlEditor Yaml编辑器(已弃用)
+- CuteCodeEditor 多语言编辑器(支持yaml、java、go、swift、dockerfile、groovy、lua、perl、python、ruby、sql、xml、vue)
+
+#### 前端业务组件
+
+> 组件所在路径:cutejava-front/src/views/components/business
+
+- CuteDeptTree 部门树
+- CuteProductLineSelect 产品线选择框
+- CuteProductLineSelectPro 产品线级联选择框
+- CuteUserSelect 用户多选框
+ 
+- CuteFileUpload 上传文件到OSS, 必须结合Minio使用(上传完成后必须销毁组件)
+ 
+- CuteFileDragUpload 支持拖拽上传文件到OSS, 必须结合Minio使用(上传完成后必须销毁组件)
+ 
+- CutePipelineNode 流水线节点组件
+ 
+
+#### 系统模块
+
+- cutejava-framework:系统基础框架。提供核心功能,如:权限、数据权限、异常处理、缓存、工具类、接口限流、接口防重、接口幂等。
+- cutejava-system:系统功能模块。提供用户、角色、菜单、部门、岗位、字典、定时任务、邮件、Minio存储、服务监控等功能
+- cutejava-devops:devops模块,已实现流水线功能。参考阿里云云效,提供流水线功能,可配置流水线任务,并支持任务依赖、任务参数、任务参数校验、任务参数回填。
+
+#### 特别鸣谢
+
+- 感谢 [elunez](https://github.com/elunez/eladmin-mp) 大佬提供的基础框架
+- 感谢 [aizuda](https://mongoplus.com/) 大佬提供的Mongodb框架
+ - 建表参考 'cutejava/doc/mongodb.md'
diff --git a/commit.sh b/commit.sh
new file mode 100644
index 00000000..ce2dfad4
--- /dev/null
+++ b/commit.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+is_weekend() {
+ day=$(date +%u)
+ [ "$day" -eq 6 ] || [ "$day" -eq 7 ]
+}
+
+if is_weekend; then
+ # 如果是周末,使用当前时间
+ git add .
+ git commit -m "$1"
+ git push
+else
+ # 如果不是周末,设置为最近的周末时间
+ day=$(date +%u)
+ if [ "$day" -le 5 ]; then
+ # 周一到周五,设置为即将到来的周六
+ days_until_saturday=$((6 - day))
+ weekend_date=$(date -d "$days_until_saturday days" "+%Y-%m-%d 12:00:00")
+ else
+ # 周日,使用昨天(周六)
+ weekend_date=$(date -d "yesterday" "+%Y-%m-%d 12:00:00")
+ fi
+
+ export GIT_AUTHOR_DATE="$weekend_date"
+ export GIT_COMMITTER_DATE="$weekend_date"
+
+ git add .
+ git commit -m "$1"
+ git push
+
+ unset GIT_AUTHOR_DATE
+ unset GIT_COMMITTER_DATE
+fi
diff --git a/cutejava-front/.editorconfig b/cutejava-front/.editorconfig
index 3454886e..d6da2515 100644
--- a/cutejava-front/.editorconfig
+++ b/cutejava-front/.editorconfig
@@ -1,14 +1,14 @@
-# https://editorconfig.org
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.md]
-insert_final_newline = false
-trim_trailing_whitespace = false
+# https://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+insert_final_newline = false
+trim_trailing_whitespace = false
diff --git a/cutejava-front/.env.development b/cutejava-front/.env.development
index d9a21321..67008828 100644
--- a/cutejava-front/.env.development
+++ b/cutejava-front/.env.development
@@ -1,8 +1,8 @@
-ENV = 'development'
-
-# 接口地址
-VUE_APP_BASE_API = 'http://localhost:8000'
-VUE_APP_WS_API = 'ws://localhost:8000'
-
-# 是否启用 babel-plugin-dynamic-import-node插件
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
+ENV = 'development'
+
+# 接口地址
+VUE_APP_BASE_API = 'http://localhost:8000'
+VUE_APP_WS_API = 'ws://localhost:8000'
+
+# 是否启用 babel-plugin-dynamic-import-node插件
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/cutejava-front/.env.production b/cutejava-front/.env.production
index d680afa7..6eb35d33 100644
--- a/cutejava-front/.env.production
+++ b/cutejava-front/.env.production
@@ -1,7 +1,7 @@
-ENV = 'production'
-
-# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
-# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
-VUE_APP_BASE_API = 'https://cutejava-api.odboy.cn'
-# 如果接口是 http 形式, wss 需要改为 ws
-VUE_APP_WS_API = 'wss://cutejava-api.odboy.cn'
+ENV = 'production'
+
+# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
+# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
+VUE_APP_BASE_API = 'https://cutejava-api.odboy.cn'
+# 如果接口是 http 形式, wss 需要改为 ws
+VUE_APP_WS_API = 'wss://cutejava-api.odboy.cn'
diff --git a/cutejava-front/.eslintignore b/cutejava-front/.eslintignore
index e6529fc0..e3a871f3 100644
--- a/cutejava-front/.eslintignore
+++ b/cutejava-front/.eslintignore
@@ -1,4 +1,4 @@
-build/*.js
-src/assets
-public
-dist
+build/*.js
+src/assets
+public
+dist
diff --git a/cutejava-front/.eslintrc.js b/cutejava-front/.eslintrc.js
index c9775054..2d44d7b5 100644
--- a/cutejava-front/.eslintrc.js
+++ b/cutejava-front/.eslintrc.js
@@ -1,198 +1,198 @@
-module.exports = {
- root: true,
- parserOptions: {
- parser: 'babel-eslint',
- sourceType: 'module'
- },
- env: {
- browser: true,
- node: true,
- es6: true,
- },
- extends: ['plugin:vue/recommended', 'eslint:recommended'],
-
- // add your custom rules here
- //it is base on https://github.com/vuejs/eslint-config-vue
- rules: {
- "vue/max-attributes-per-line": [2, {
- "singleline": 10,
- "multiline": {
- "max": 1,
- "allowFirstLine": false
- }
- }],
- "vue/singleline-html-element-content-newline": "off",
- "vue/multiline-html-element-content-newline":"off",
- "vue/name-property-casing": ["error", "PascalCase"],
- "vue/no-v-html": "off",
- 'accessor-pairs': 2,
- 'arrow-spacing': [2, {
- 'before': true,
- 'after': true
- }],
- 'block-spacing': [2, 'always'],
- 'brace-style': [2, '1tbs', {
- 'allowSingleLine': true
- }],
- 'camelcase': [0, {
- 'properties': 'always'
- }],
- 'comma-dangle': [2, 'never'],
- 'comma-spacing': [2, {
- 'before': false,
- 'after': true
- }],
- 'comma-style': [2, 'last'],
- 'constructor-super': 2,
- 'curly': [2, 'multi-line'],
- 'dot-location': [2, 'property'],
- 'eol-last': 2,
- 'eqeqeq': ["error", "always", {"null": "ignore"}],
- 'generator-star-spacing': [2, {
- 'before': true,
- 'after': true
- }],
- 'handle-callback-err': [2, '^(err|error)$'],
- 'indent': [2, 2, {
- 'SwitchCase': 1
- }],
- 'jsx-quotes': [2, 'prefer-single'],
- 'key-spacing': [2, {
- 'beforeColon': false,
- 'afterColon': true
- }],
- 'keyword-spacing': [2, {
- 'before': true,
- 'after': true
- }],
- 'new-cap': [2, {
- 'newIsCap': true,
- 'capIsNew': false
- }],
- 'new-parens': 2,
- 'no-array-constructor': 2,
- 'no-caller': 2,
- 'no-console': 'off',
- 'no-class-assign': 2,
- 'no-cond-assign': 2,
- 'no-const-assign': 2,
- 'no-control-regex': 0,
- 'no-delete-var': 2,
- 'no-dupe-args': 2,
- 'no-dupe-class-members': 2,
- 'no-dupe-keys': 2,
- 'no-duplicate-case': 2,
- 'no-empty-character-class': 2,
- 'no-empty-pattern': 2,
- 'no-eval': 2,
- 'no-ex-assign': 2,
- 'no-extend-native': 2,
- 'no-extra-bind': 2,
- 'no-extra-boolean-cast': 2,
- 'no-extra-parens': [2, 'functions'],
- 'no-fallthrough': 2,
- 'no-floating-decimal': 2,
- 'no-func-assign': 2,
- 'no-implied-eval': 2,
- 'no-inner-declarations': [2, 'functions'],
- 'no-invalid-regexp': 2,
- 'no-irregular-whitespace': 2,
- 'no-iterator': 2,
- 'no-label-var': 2,
- 'no-labels': [2, {
- 'allowLoop': false,
- 'allowSwitch': false
- }],
- 'no-lone-blocks': 2,
- 'no-mixed-spaces-and-tabs': 2,
- 'no-multi-spaces': 2,
- 'no-multi-str': 2,
- 'no-multiple-empty-lines': [2, {
- 'max': 1
- }],
- 'no-native-reassign': 2,
- 'no-negated-in-lhs': 2,
- 'no-new-object': 2,
- 'no-new-require': 2,
- 'no-new-symbol': 2,
- 'no-new-wrappers': 2,
- 'no-obj-calls': 2,
- 'no-octal': 2,
- 'no-octal-escape': 2,
- 'no-path-concat': 2,
- 'no-proto': 2,
- 'no-redeclare': 2,
- 'no-regex-spaces': 2,
- 'no-return-assign': [2, 'except-parens'],
- 'no-self-assign': 2,
- 'no-self-compare': 2,
- 'no-sequences': 2,
- 'no-shadow-restricted-names': 2,
- 'no-spaced-func': 2,
- 'no-sparse-arrays': 2,
- 'no-this-before-super': 2,
- 'no-throw-literal': 2,
- 'no-trailing-spaces': 2,
- 'no-undef': 2,
- 'no-undef-init': 2,
- 'no-unexpected-multiline': 2,
- 'no-unmodified-loop-condition': 2,
- 'no-unneeded-ternary': [2, {
- 'defaultAssignment': false
- }],
- 'no-unreachable': 2,
- 'no-unsafe-finally': 2,
- 'no-unused-vars': [2, {
- 'vars': 'all',
- 'args': 'none'
- }],
- 'no-useless-call': 2,
- 'no-useless-computed-key': 2,
- 'no-useless-constructor': 2,
- 'no-useless-escape': 0,
- 'no-whitespace-before-property': 2,
- 'no-with': 2,
- 'one-var': [2, {
- 'initialized': 'never'
- }],
- 'operator-linebreak': [2, 'after', {
- 'overrides': {
- '?': 'before',
- ':': 'before'
- }
- }],
- 'padded-blocks': [2, 'never'],
- 'quotes': [2, 'single', {
- 'avoidEscape': true,
- 'allowTemplateLiterals': true
- }],
- 'semi': [2, 'never'],
- 'semi-spacing': [2, {
- 'before': false,
- 'after': true
- }],
- 'space-before-blocks': [2, 'always'],
- 'space-before-function-paren': [2, 'never'],
- 'space-in-parens': [2, 'never'],
- 'space-infix-ops': 2,
- 'space-unary-ops': [2, {
- 'words': true,
- 'nonwords': false
- }],
- 'spaced-comment': [2, 'always', {
- 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
- }],
- 'template-curly-spacing': [2, 'never'],
- 'use-isnan': 2,
- 'valid-typeof': 2,
- 'wrap-iife': [2, 'any'],
- 'yield-star-spacing': [2, 'both'],
- 'yoda': [2, 'never'],
- 'prefer-const': 2,
- 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
- 'object-curly-spacing': [2, 'always', {
- objectsInObjects: false
- }],
- 'array-bracket-spacing': [2, 'never']
- }
-}
+module.exports = {
+ root: true,
+ parserOptions: {
+ parser: 'babel-eslint',
+ sourceType: 'module'
+ },
+ env: {
+ browser: true,
+ node: true,
+ es6: true,
+ },
+ extends: ['plugin:vue/recommended', 'eslint:recommended'],
+
+ // add your custom rules here
+ //it is base on https://github.com/vuejs/eslint-config-vue
+ rules: {
+ "vue/max-attributes-per-line": [2, {
+ "singleline": 10,
+ "multiline": {
+ "max": 1,
+ "allowFirstLine": false
+ }
+ }],
+ "vue/singleline-html-element-content-newline": "off",
+ "vue/multiline-html-element-content-newline":"off",
+ "vue/name-property-casing": ["error", "PascalCase"],
+ "vue/no-v-html": "off",
+ 'accessor-pairs': 2,
+ 'arrow-spacing': [2, {
+ 'before': true,
+ 'after': true
+ }],
+ 'block-spacing': [2, 'always'],
+ 'brace-style': [2, '1tbs', {
+ 'allowSingleLine': true
+ }],
+ 'camelcase': [0, {
+ 'properties': 'always'
+ }],
+ 'comma-dangle': [2, 'never'],
+ 'comma-spacing': [2, {
+ 'before': false,
+ 'after': true
+ }],
+ 'comma-style': [2, 'last'],
+ 'constructor-super': 2,
+ 'curly': [2, 'multi-line'],
+ 'dot-location': [2, 'property'],
+ 'eol-last': 2,
+ 'eqeqeq': ["error", "always", {"null": "ignore"}],
+ 'generator-star-spacing': [2, {
+ 'before': true,
+ 'after': true
+ }],
+ 'handle-callback-err': [2, '^(err|error)$'],
+ 'indent': [2, 2, {
+ 'SwitchCase': 1
+ }],
+ 'jsx-quotes': [2, 'prefer-single'],
+ 'key-spacing': [2, {
+ 'beforeColon': false,
+ 'afterColon': true
+ }],
+ 'keyword-spacing': [2, {
+ 'before': true,
+ 'after': true
+ }],
+ 'new-cap': [2, {
+ 'newIsCap': true,
+ 'capIsNew': false
+ }],
+ 'new-parens': 2,
+ 'no-array-constructor': 2,
+ 'no-caller': 2,
+ 'no-console': 'off',
+ 'no-class-assign': 2,
+ 'no-cond-assign': 2,
+ 'no-const-assign': 2,
+ 'no-control-regex': 0,
+ 'no-delete-var': 2,
+ 'no-dupe-args': 2,
+ 'no-dupe-class-members': 2,
+ 'no-dupe-keys': 2,
+ 'no-duplicate-case': 2,
+ 'no-empty-character-class': 2,
+ 'no-empty-pattern': 2,
+ 'no-eval': 2,
+ 'no-ex-assign': 2,
+ 'no-extend-native': 2,
+ 'no-extra-bind': 2,
+ 'no-extra-boolean-cast': 2,
+ 'no-extra-parens': [2, 'functions'],
+ 'no-fallthrough': 2,
+ 'no-floating-decimal': 2,
+ 'no-func-assign': 2,
+ 'no-implied-eval': 2,
+ 'no-inner-declarations': [2, 'functions'],
+ 'no-invalid-regexp': 2,
+ 'no-irregular-whitespace': 2,
+ 'no-iterator': 2,
+ 'no-label-var': 2,
+ 'no-labels': [2, {
+ 'allowLoop': false,
+ 'allowSwitch': false
+ }],
+ 'no-lone-blocks': 2,
+ 'no-mixed-spaces-and-tabs': 2,
+ 'no-multi-spaces': 2,
+ 'no-multi-str': 2,
+ 'no-multiple-empty-lines': [2, {
+ 'max': 1
+ }],
+ 'no-native-reassign': 2,
+ 'no-negated-in-lhs': 2,
+ 'no-new-object': 2,
+ 'no-new-require': 2,
+ 'no-new-symbol': 2,
+ 'no-new-wrappers': 2,
+ 'no-obj-calls': 2,
+ 'no-octal': 2,
+ 'no-octal-escape': 2,
+ 'no-path-concat': 2,
+ 'no-proto': 2,
+ 'no-redeclare': 2,
+ 'no-regex-spaces': 2,
+ 'no-return-assign': [2, 'except-parens'],
+ 'no-self-assign': 2,
+ 'no-self-compare': 2,
+ 'no-sequences': 2,
+ 'no-shadow-restricted-names': 2,
+ 'no-spaced-func': 2,
+ 'no-sparse-arrays': 2,
+ 'no-this-before-super': 2,
+ 'no-throw-literal': 2,
+ 'no-trailing-spaces': 2,
+ 'no-undef': 2,
+ 'no-undef-init': 2,
+ 'no-unexpected-multiline': 2,
+ 'no-unmodified-loop-condition': 2,
+ 'no-unneeded-ternary': [2, {
+ 'defaultAssignment': false
+ }],
+ 'no-unreachable': 2,
+ 'no-unsafe-finally': 2,
+ 'no-unused-vars': [2, {
+ 'vars': 'all',
+ 'args': 'none'
+ }],
+ 'no-useless-call': 2,
+ 'no-useless-computed-key': 2,
+ 'no-useless-constructor': 2,
+ 'no-useless-escape': 0,
+ 'no-whitespace-before-property': 2,
+ 'no-with': 2,
+ 'one-var': [2, {
+ 'initialized': 'never'
+ }],
+ 'operator-linebreak': [2, 'after', {
+ 'overrides': {
+ '?': 'before',
+ ':': 'before'
+ }
+ }],
+ 'padded-blocks': [2, 'never'],
+ 'quotes': [2, 'single', {
+ 'avoidEscape': true,
+ 'allowTemplateLiterals': true
+ }],
+ 'semi': [2, 'never'],
+ 'semi-spacing': [2, {
+ 'before': false,
+ 'after': true
+ }],
+ 'space-before-blocks': [2, 'always'],
+ 'space-before-function-paren': [2, 'never'],
+ 'space-in-parens': [2, 'never'],
+ 'space-infix-ops': 2,
+ 'space-unary-ops': [2, {
+ 'words': true,
+ 'nonwords': false
+ }],
+ 'spaced-comment': [2, 'always', {
+ 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
+ }],
+ 'template-curly-spacing': [2, 'never'],
+ 'use-isnan': 2,
+ 'valid-typeof': 2,
+ 'wrap-iife': [2, 'any'],
+ 'yield-star-spacing': [2, 'both'],
+ 'yoda': [2, 'never'],
+ 'prefer-const': 2,
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+ 'object-curly-spacing': [2, 'always', {
+ objectsInObjects: false
+ }],
+ 'array-bracket-spacing': [2, 'never']
+ }
+}
diff --git a/cutejava-front/.gitignore b/cutejava-front/.gitignore
index 78a752d8..2c9b3a73 100644
--- a/cutejava-front/.gitignore
+++ b/cutejava-front/.gitignore
@@ -1,23 +1,23 @@
-.DS_Store
-node_modules/
-dist/
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-**/*.log
-
-tests/**/coverage/
-tests/e2e/reports
-selenium-debug.log
-
-# Editor directories and files
-.idea
-.vscode
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.local
-
-package-lock.json
-yarn.lock
+.DS_Store
+node_modules/
+dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+
+package-lock.json
+yarn.lock
diff --git a/cutejava-front/.travis.yml b/cutejava-front/.travis.yml
index f4be7a08..a95f7bb0 100644
--- a/cutejava-front/.travis.yml
+++ b/cutejava-front/.travis.yml
@@ -1,5 +1,5 @@
-language: node_js
-node_js: 10
-script: npm run test
-notifications:
- email: false
+language: node_js
+node_js: 10
+script: npm run test
+notifications:
+ email: false
diff --git a/cutejava-front/LICENSE b/cutejava-front/LICENSE
index aae98709..94343fa3 100644
--- a/cutejava-front/LICENSE
+++ b/cutejava-front/LICENSE
@@ -1,191 +1,191 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "{}" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright 2022 Odboy
-
- 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.
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "{}" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+ Copyright 2022 Odboy
+
+ 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.
diff --git a/cutejava-front/README.md b/cutejava-front/README.md
index 5141af4b..ceee37df 100644
--- a/cutejava-front/README.md
+++ b/cutejava-front/README.md
@@ -1,51 +1,51 @@
-# cutejava-ui
-
-#### 前端模板
-
-初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
-
-模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
-
-## 快速开始
-
-### 环境要求
-
-**推荐 node 版本:12-16 LTS**
-
-### 安装依赖
-
-``` bash
-# 安装依赖(依赖python)
-npm install --registry https://registry.npmmirror.com
-```
-
-### 启动服务
-
-```bash
-# 启动服务 localhost:8013
-npm run dev
-
-# (或) 启动服务 localhost:8013
-IDEA -> Current File -> Edit Configurations... -> Add New Configuration -> npm -> Script选dev -> Apply -> Ok
-
-# 构建生产环境
-npm run build:prod
-```
-
-#### 常见问题
-
-1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
-
-解决方案:
-```
-1. 单独安装:npm install --unsafe-perm node-sass
-2. 直接使用:npm install --unsafe-perm
-```
-
-2、加速node-sass安装
-
-https://www.ydyno.com/archives/1219.html
-
-#### 特别鸣谢
-
-- 感谢 [elunez](https://github.com/elunez/eladmin-mp) 大佬提供的基础框架
+# cutejava-ui
+
+#### 前端模板
+
+初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
+
+模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
+
+## 快速开始
+
+### 环境要求
+
+**推荐 node 版本:12-16 LTS**
+
+### 安装依赖
+
+``` bash
+# 安装依赖(依赖python)
+npm install --registry https://registry.npmmirror.com
+```
+
+### 启动服务
+
+```bash
+# 启动服务 localhost:8013
+npm run dev
+
+# (或) 启动服务 localhost:8013
+IDEA -> Current File -> Edit Configurations... -> Add New Configuration -> npm -> Script选dev -> Apply -> Ok
+
+# 构建生产环境
+npm run build:prod
+```
+
+#### 常见问题
+
+1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
+
+解决方案:
+```
+1. 单独安装:npm install --unsafe-perm node-sass
+2. 直接使用:npm install --unsafe-perm
+```
+
+2、加速node-sass安装
+
+https://www.ydyno.com/archives/1219.html
+
+#### 特别鸣谢
+
+- 感谢 [elunez](https://github.com/elunez/eladmin-mp) 大佬提供的基础框架
diff --git a/cutejava-front/babel.config.js b/cutejava-front/babel.config.js
index 804632a0..682b736f 100644
--- a/cutejava-front/babel.config.js
+++ b/cutejava-front/babel.config.js
@@ -1,11 +1,11 @@
-const plugins = ['@vue/babel-plugin-transform-vue-jsx']
-// 生产环境移除console
-if (process.env.NODE_ENV === 'production') {
- plugins.push('transform-remove-console')
-}
-module.exports = {
- plugins: plugins,
- presets: [
- '@vue/app'
- ]
-}
+const plugins = ['@vue/babel-plugin-transform-vue-jsx']
+// 生产环境移除console
+if (process.env.NODE_ENV === 'production') {
+ plugins.push('transform-remove-console')
+}
+module.exports = {
+ plugins: plugins,
+ presets: [
+ '@vue/app'
+ ]
+}
diff --git a/cutejava-front/jest.config.js b/cutejava-front/jest.config.js
index 143cdc86..ca6c565a 100644
--- a/cutejava-front/jest.config.js
+++ b/cutejava-front/jest.config.js
@@ -1,24 +1,24 @@
-module.exports = {
- moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
- transform: {
- '^.+\\.vue$': 'vue-jest',
- '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
- 'jest-transform-stub',
- '^.+\\.jsx?$': 'babel-jest'
- },
- moduleNameMapper: {
- '^@/(.*)$': '/src/$1'
- },
- snapshotSerializers: ['jest-serializer-vue'],
- testMatch: [
- '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
- ],
- collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
- coverageDirectory: '/tests/unit/coverage',
- // 'collectCoverage': true,
- 'coverageReporters': [
- 'lcov',
- 'text-summary'
- ],
- testURL: 'http://localhost/'
-}
+module.exports = {
+ moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
+ transform: {
+ '^.+\\.vue$': 'vue-jest',
+ '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
+ 'jest-transform-stub',
+ '^.+\\.jsx?$': 'babel-jest'
+ },
+ moduleNameMapper: {
+ '^@/(.*)$': '/src/$1'
+ },
+ snapshotSerializers: ['jest-serializer-vue'],
+ testMatch: [
+ '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
+ ],
+ collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
+ coverageDirectory: '/tests/unit/coverage',
+ // 'collectCoverage': true,
+ 'coverageReporters': [
+ 'lcov',
+ 'text-summary'
+ ],
+ testURL: 'http://localhost/'
+}
diff --git a/cutejava-front/package.json b/cutejava-front/package.json
index 0b91b187..d0c24bd8 100644
--- a/cutejava-front/package.json
+++ b/cutejava-front/package.json
@@ -1,6 +1,6 @@
{
"name": "cutejava-front",
- "version": "1.3.0",
+ "version": "1.4.0",
"description": "CuteJava 前端源码",
"author": "Odboy",
"license": "Apache-2.0",
@@ -48,6 +48,7 @@
"element-ui": "^2.15.14",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
+ "html2canvas": "^1.4.1",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
diff --git a/cutejava-front/plopfile.js b/cutejava-front/plopfile.js
index 9f3147e2..725c51b4 100644
--- a/cutejava-front/plopfile.js
+++ b/cutejava-front/plopfile.js
@@ -1,7 +1,7 @@
-const viewGenerator = require('./plop-templates/view/prompt')
-const componentGenerator = require('./plop-templates/component/prompt')
-
-module.exports = function(plop) {
- plop.setGenerator('view', viewGenerator)
- plop.setGenerator('component', componentGenerator)
-}
+const viewGenerator = require('./plop-templates/view/prompt')
+const componentGenerator = require('./plop-templates/component/prompt')
+
+module.exports = function(plop) {
+ plop.setGenerator('view', viewGenerator)
+ plop.setGenerator('component', componentGenerator)
+}
diff --git a/cutejava-front/postcss.config.js b/cutejava-front/postcss.config.js
index 961986e2..2be0631d 100644
--- a/cutejava-front/postcss.config.js
+++ b/cutejava-front/postcss.config.js
@@ -1,5 +1,5 @@
-module.exports = {
- plugins: {
- autoprefixer: {}
- }
-}
+module.exports = {
+ plugins: {
+ autoprefixer: {}
+ }
+}
diff --git a/cutejava-front/public/index.html b/cutejava-front/public/index.html
index e9185009..f1df85d6 100644
--- a/cutejava-front/public/index.html
+++ b/cutejava-front/public/index.html
@@ -1,15 +1,15 @@
-
-
-
-
-
-
-
-
- <%= webpackConfig.name %>
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ <%= webpackConfig.name %>
+
+
+
+
+
+
diff --git a/cutejava-front/public/robots.txt b/cutejava-front/public/robots.txt
index 77470cb3..c2aab7e0 100644
--- a/cutejava-front/public/robots.txt
+++ b/cutejava-front/public/robots.txt
@@ -1,2 +1,2 @@
-User-agent: *
+User-agent: *
Disallow: /
\ No newline at end of file
diff --git a/cutejava-front/src/App.vue b/cutejava-front/src/App.vue
index ec9032c1..df5e0ca2 100644
--- a/cutejava-front/src/App.vue
+++ b/cutejava-front/src/App.vue
@@ -1,11 +1,11 @@
-
-
+
+
+
+
+
diff --git a/cutejava-front/vue.config.js b/cutejava-front/vue.config.js
index 10bd5146..f9454fe7 100644
--- a/cutejava-front/vue.config.js
+++ b/cutejava-front/vue.config.js
@@ -1,148 +1,148 @@
-'use strict'
-const path = require('path')
-const defaultSettings = require('./src/settings.js')
-const CompressionPlugin = require('compression-webpack-plugin')
-
-function resolve(dir) {
- return path.join(__dirname, dir)
-}
-
-const name = defaultSettings.title // 网址标题
-const port = 8013 // 端口配置
-
-// All configuration item explanations can be find in https://cli.vuejs.org/config/
-module.exports = {
- // hash 模式下可使用
- // publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
- publicPath: '/',
- outputDir: 'dist',
- assetsDir: 'static',
- lintOnSave: process.env.NODE_ENV === 'development',
- productionSourceMap: false,
- devServer: {
- port: port,
- // 启动后打开页面
- open: false,
- overlay: {
- warnings: false,
- errors: true
- },
- proxy: {
- '/api': {
- target: process.env.VUE_APP_BASE_API,
- changeOrigin: true,
- pathRewrite: {
- '^/api': 'api'
- }
- },
- '/auth': {
- target: process.env.VUE_APP_BASE_API,
- changeOrigin: true,
- pathRewrite: {
- '^/auth': 'auth'
- }
- }
- }
- },
- configureWebpack: {
- // provide the app's title in webpack's name field, so that
- // it can be accessed in index.html to inject the correct title.
- name: name,
- resolve: {
- alias: {
- '@': resolve('src'),
- '@crud': resolve('src/components/Crud')
- }
- },
- plugins: [
- // https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件
- new CompressionPlugin({
- test: /\.(js|css|html)?$/i, // 压缩文件格式
- filename: '[path].gz[query]', // 压缩后的文件名
- algorithm: 'gzip', // 使用gzip压缩
- minRatio: 0.8 // 压缩率小于1才会压缩
- })
- ]
- },
- chainWebpack(config) {
- config.plugins.delete('preload') // TODO: need test
- config.plugins.delete('prefetch') // TODO: need test
-
- // set svg-sprite-loader
- config.module
- .rule('svg')
- .exclude.add(resolve('src/assets/icons'))
- .end()
- config.module
- .rule('icons')
- .test(/\.svg$/)
- .include.add(resolve('src/assets/icons'))
- .end()
- .use('svg-sprite-loader')
- .loader('svg-sprite-loader')
- .options({
- symbolId: 'icon-[name]'
- })
- .end()
-
- // set preserveWhitespace
- config.module
- .rule('vue')
- .use('vue-loader')
- .loader('vue-loader')
- .tap(options => {
- options.compilerOptions.preserveWhitespace = true
- return options
- })
- .end()
-
- config
- // https://webpack.js.org/configuration/devtool/#development
- .when(process.env.NODE_ENV === 'development',
- config => config.devtool('cheap-source-map')
- )
-
- config
- .when(process.env.NODE_ENV !== 'development',
- config => {
- config
- .plugin('ScriptExtHtmlWebpackPlugin')
- .after('html')
- .use('script-ext-html-webpack-plugin', [{
- // `runtime` must same as runtimeChunk name. default is `runtime`
- inline: /runtime\..*\.js$/
- }])
- .end()
- config
- .optimization.splitChunks({
- chunks: 'all',
- cacheGroups: {
- libs: {
- name: 'chunk-libs',
- test: /[\\/]node_modules[\\/]/,
- priority: 10,
- chunks: 'initial' // only package third parties that are initially dependent
- },
- elementUI: {
- name: 'chunk-elementUI', // split elementUI into a single package
- priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
- test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
- },
- commons: {
- name: 'chunk-commons',
- test: resolve('src/components'), // can customize your rules
- minChunks: 3, // minimum common number
- priority: 5,
- reuseExistingChunk: true
- }
- }
- })
- config.optimization.runtimeChunk('single')
- }
- )
- },
- transpileDependencies: [
- 'vue-echarts',
- 'resize-detector'
- ]
-}
+'use strict'
+const path = require('path')
+const defaultSettings = require('./src/settings.js')
+const CompressionPlugin = require('compression-webpack-plugin')
+
+function resolve(dir) {
+ return path.join(__dirname, dir)
+}
+
+const name = defaultSettings.title // 网址标题
+const port = 8013 // 端口配置
+
+// All configuration item explanations can be find in https://cli.vuejs.org/config/
+module.exports = {
+ // hash 模式下可使用
+ // publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
+ publicPath: '/',
+ outputDir: 'dist',
+ assetsDir: 'static',
+ lintOnSave: process.env.NODE_ENV === 'development',
+ productionSourceMap: false,
+ devServer: {
+ port: port,
+ // 启动后打开页面
+ open: false,
+ overlay: {
+ warnings: false,
+ errors: true
+ },
+ proxy: {
+ '/api': {
+ target: process.env.VUE_APP_BASE_API,
+ changeOrigin: true,
+ pathRewrite: {
+ '^/api': 'api'
+ }
+ },
+ '/auth': {
+ target: process.env.VUE_APP_BASE_API,
+ changeOrigin: true,
+ pathRewrite: {
+ '^/auth': 'auth'
+ }
+ }
+ }
+ },
+ configureWebpack: {
+ // provide the app's title in webpack's name field, so that
+ // it can be accessed in index.html to inject the correct title.
+ name: name,
+ resolve: {
+ alias: {
+ '@': resolve('src'),
+ '@crud': resolve('src/components/Crud')
+ }
+ },
+ plugins: [
+ // https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件
+ new CompressionPlugin({
+ test: /\.(js|css|html)?$/i, // 压缩文件格式
+ filename: '[path].gz[query]', // 压缩后的文件名
+ algorithm: 'gzip', // 使用gzip压缩
+ minRatio: 0.8 // 压缩率小于1才会压缩
+ })
+ ]
+ },
+ chainWebpack(config) {
+ config.plugins.delete('preload') // TODO: need test
+ config.plugins.delete('prefetch') // TODO: need test
+
+ // set svg-sprite-loader
+ config.module
+ .rule('svg')
+ .exclude.add(resolve('src/assets/icons'))
+ .end()
+ config.module
+ .rule('icons')
+ .test(/\.svg$/)
+ .include.add(resolve('src/assets/icons'))
+ .end()
+ .use('svg-sprite-loader')
+ .loader('svg-sprite-loader')
+ .options({
+ symbolId: 'icon-[name]'
+ })
+ .end()
+
+ // set preserveWhitespace
+ config.module
+ .rule('vue')
+ .use('vue-loader')
+ .loader('vue-loader')
+ .tap(options => {
+ options.compilerOptions.preserveWhitespace = true
+ return options
+ })
+ .end()
+
+ config
+ // https://webpack.js.org/configuration/devtool/#development
+ .when(process.env.NODE_ENV === 'development',
+ config => config.devtool('cheap-source-map')
+ )
+
+ config
+ .when(process.env.NODE_ENV !== 'development',
+ config => {
+ config
+ .plugin('ScriptExtHtmlWebpackPlugin')
+ .after('html')
+ .use('script-ext-html-webpack-plugin', [{
+ // `runtime` must same as runtimeChunk name. default is `runtime`
+ inline: /runtime\..*\.js$/
+ }])
+ .end()
+ config
+ .optimization.splitChunks({
+ chunks: 'all',
+ cacheGroups: {
+ libs: {
+ name: 'chunk-libs',
+ test: /[\\/]node_modules[\\/]/,
+ priority: 10,
+ chunks: 'initial' // only package third parties that are initially dependent
+ },
+ elementUI: {
+ name: 'chunk-elementUI', // split elementUI into a single package
+ priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+ test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
+ },
+ commons: {
+ name: 'chunk-commons',
+ test: resolve('src/components'), // can customize your rules
+ minChunks: 3, // minimum common number
+ priority: 5,
+ reuseExistingChunk: true
+ }
+ }
+ })
+ config.optimization.runtimeChunk('single')
+ }
+ )
+ },
+ transpileDependencies: [
+ 'vue-echarts',
+ 'resize-detector'
+ ]
+}
diff --git a/cutejava/.gitignore b/cutejava/.gitignore
index a4dad206..ce374b0e 100644
--- a/cutejava/.gitignore
+++ b/cutejava/.gitignore
@@ -1,9 +1,9 @@
-### IDEA ###
-.DS_Store
-~/*
-.idea/*
-*.iml
-*/target/*
-*/*.iml
-/.gradle/
+### IDEA ###
+.DS_Store
+~/*
+.idea/*
+*.iml
+*/target/*
+*/*.iml
+/.gradle/
/application.pid
\ No newline at end of file
diff --git a/cutejava/LICENSE b/cutejava/LICENSE
index 485efc74..fe57103d 100644
--- a/cutejava/LICENSE
+++ b/cutejava/LICENSE
@@ -1,191 +1,191 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "{}" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright 2022-2025 Odboy
-
- 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
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "{}" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+ Copyright 2022-2025 Odboy
+
+ 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.
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/pom.xml b/cutejava/cutejava-framework/pom.xml
index cfdb3b22..58cc61f1 100644
--- a/cutejava/cutejava-framework/pom.xml
+++ b/cutejava/cutejava-framework/pom.xml
@@ -1,12 +1,12 @@
-
-
-
- cutejava
- cn.odboy
- 1.4.1
-
- 4.0.0
- cutejava-framework
- 公共模块
+
+
+
+ cutejava
+ cn.odboy
+ 1.4.1
+
+ 4.0.0
+ cutejava-framework
+ 公共模块
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousAccess.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousAccess.java
index 5131210d..9d539f21 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousAccess.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousAccess.java
@@ -1,29 +1,29 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import java.lang.annotation.*;
-
-/**
- * 用于标记匿名访问方法
- */
-@Inherited
-@Documented
-@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface AnonymousAccess {
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 用于标记匿名访问方法
+ */
+@Inherited
+@Documented
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface AnonymousAccess {
+
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousDeleteMapping.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousDeleteMapping.java
index 041daa15..3bb92e05 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousDeleteMapping.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousDeleteMapping.java
@@ -1,75 +1,75 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import java.lang.annotation.*;
-
-/**
- * Annotation for mapping HTTP {@code DELETE} requests onto specific handler methods. 支持匿名访问 DeleteMapping
- *
- * @see AnonymousGetMapping
- * @see AnonymousPostMapping
- * @see AnonymousPutMapping
- * @see AnonymousPatchMapping
- * @see RequestMapping
- */
-@AnonymousAccess
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@RequestMapping(method = RequestMethod.DELETE)
-public @interface AnonymousDeleteMapping {
-
- /**
- * Alias for {@link RequestMapping#name}.
- */
- @AliasFor(annotation = RequestMapping.class) String name() default "";
-
- /**
- * Alias for {@link RequestMapping#value}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] value() default {};
-
- /**
- * Alias for {@link RequestMapping#path}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] path() default {};
-
- /**
- * Alias for {@link RequestMapping#params}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] params() default {};
-
- /**
- * Alias for {@link RequestMapping#headers}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
-
- /**
- * Alias for {@link RequestMapping#consumes}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
-
- /**
- * Alias for {@link RequestMapping#produces}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import org.springframework.core.annotation.AliasFor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation for mapping HTTP {@code DELETE} requests onto specific handler methods. 支持匿名访问 DeleteMapping
+ *
+ * @see AnonymousGetMapping
+ * @see AnonymousPostMapping
+ * @see AnonymousPutMapping
+ * @see AnonymousPatchMapping
+ * @see RequestMapping
+ */
+@AnonymousAccess
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@RequestMapping(method = RequestMethod.DELETE)
+public @interface AnonymousDeleteMapping {
+
+ /**
+ * Alias for {@link RequestMapping#name}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String name() default "";
+
+ /**
+ * Alias for {@link RequestMapping#value}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] value() default {};
+
+ /**
+ * Alias for {@link RequestMapping#path}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] path() default {};
+
+ /**
+ * Alias for {@link RequestMapping#params}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] params() default {};
+
+ /**
+ * Alias for {@link RequestMapping#headers}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
+
+ /**
+ * Alias for {@link RequestMapping#consumes}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
+
+ /**
+ * Alias for {@link RequestMapping#produces}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousGetMapping.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousGetMapping.java
index 1d1b51b0..06b5690a 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousGetMapping.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousGetMapping.java
@@ -1,75 +1,75 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import java.lang.annotation.*;
-
-/**
- * Annotation for mapping HTTP {@code GET} requests onto specific handler methods.
- *
- * 支持匿名访问 GetMapping
- *
- * @see RequestMapping
- */
-@AnonymousAccess
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@RequestMapping(method = RequestMethod.GET)
-public @interface AnonymousGetMapping {
-
- /**
- * Alias for {@link RequestMapping#name}.
- */
- @AliasFor(annotation = RequestMapping.class) String name() default "";
-
- /**
- * Alias for {@link RequestMapping#value}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] value() default {};
-
- /**
- * Alias for {@link RequestMapping#path}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] path() default {};
-
- /**
- * Alias for {@link RequestMapping#params}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] params() default {};
-
- /**
- * Alias for {@link RequestMapping#headers}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
-
- /**
- * Alias for {@link RequestMapping#consumes}.
- *
- * @since 4.3.5
- */
- @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
-
- /**
- * Alias for {@link RequestMapping#produces}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import org.springframework.core.annotation.AliasFor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation for mapping HTTP {@code GET} requests onto specific handler methods.
+ *
+ * 支持匿名访问 GetMapping
+ *
+ * @see RequestMapping
+ */
+@AnonymousAccess
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@RequestMapping(method = RequestMethod.GET)
+public @interface AnonymousGetMapping {
+
+ /**
+ * Alias for {@link RequestMapping#name}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String name() default "";
+
+ /**
+ * Alias for {@link RequestMapping#value}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] value() default {};
+
+ /**
+ * Alias for {@link RequestMapping#path}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] path() default {};
+
+ /**
+ * Alias for {@link RequestMapping#params}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] params() default {};
+
+ /**
+ * Alias for {@link RequestMapping#headers}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
+
+ /**
+ * Alias for {@link RequestMapping#consumes}.
+ *
+ * @since 4.3.5
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
+
+ /**
+ * Alias for {@link RequestMapping#produces}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPatchMapping.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPatchMapping.java
index 23a58ea0..81746e3c 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPatchMapping.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPatchMapping.java
@@ -1,75 +1,75 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import java.lang.annotation.*;
-
-/**
- * Annotation for mapping HTTP {@code PATCH} requests onto specific handler methods. 支持匿名访问 PatchMapping
- *
- * @see AnonymousGetMapping
- * @see AnonymousPostMapping
- * @see AnonymousPutMapping
- * @see AnonymousDeleteMapping
- * @see RequestMapping
- */
-@AnonymousAccess
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@RequestMapping(method = RequestMethod.PATCH)
-public @interface AnonymousPatchMapping {
-
- /**
- * Alias for {@link RequestMapping#name}.
- */
- @AliasFor(annotation = RequestMapping.class) String name() default "";
-
- /**
- * Alias for {@link RequestMapping#value}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] value() default {};
-
- /**
- * Alias for {@link RequestMapping#path}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] path() default {};
-
- /**
- * Alias for {@link RequestMapping#params}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] params() default {};
-
- /**
- * Alias for {@link RequestMapping#headers}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
-
- /**
- * Alias for {@link RequestMapping#consumes}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
-
- /**
- * Alias for {@link RequestMapping#produces}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import org.springframework.core.annotation.AliasFor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation for mapping HTTP {@code PATCH} requests onto specific handler methods. 支持匿名访问 PatchMapping
+ *
+ * @see AnonymousGetMapping
+ * @see AnonymousPostMapping
+ * @see AnonymousPutMapping
+ * @see AnonymousDeleteMapping
+ * @see RequestMapping
+ */
+@AnonymousAccess
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@RequestMapping(method = RequestMethod.PATCH)
+public @interface AnonymousPatchMapping {
+
+ /**
+ * Alias for {@link RequestMapping#name}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String name() default "";
+
+ /**
+ * Alias for {@link RequestMapping#value}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] value() default {};
+
+ /**
+ * Alias for {@link RequestMapping#path}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] path() default {};
+
+ /**
+ * Alias for {@link RequestMapping#params}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] params() default {};
+
+ /**
+ * Alias for {@link RequestMapping#headers}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
+
+ /**
+ * Alias for {@link RequestMapping#consumes}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
+
+ /**
+ * Alias for {@link RequestMapping#produces}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPostMapping.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPostMapping.java
index c3090f53..4da396bb 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPostMapping.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPostMapping.java
@@ -1,75 +1,75 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import java.lang.annotation.*;
-
-/**
- * Annotation for mapping HTTP {@code POST} requests onto specific handler methods. 支持匿名访问 PostMapping
- *
- * @see AnonymousGetMapping
- * @see AnonymousPostMapping
- * @see AnonymousPutMapping
- * @see AnonymousDeleteMapping
- * @see RequestMapping
- */
-@AnonymousAccess
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@RequestMapping(method = RequestMethod.POST)
-public @interface AnonymousPostMapping {
-
- /**
- * Alias for {@link RequestMapping#name}.
- */
- @AliasFor(annotation = RequestMapping.class) String name() default "";
-
- /**
- * Alias for {@link RequestMapping#value}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] value() default {};
-
- /**
- * Alias for {@link RequestMapping#path}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] path() default {};
-
- /**
- * Alias for {@link RequestMapping#params}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] params() default {};
-
- /**
- * Alias for {@link RequestMapping#headers}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
-
- /**
- * Alias for {@link RequestMapping#consumes}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
-
- /**
- * Alias for {@link RequestMapping#produces}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import org.springframework.core.annotation.AliasFor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation for mapping HTTP {@code POST} requests onto specific handler methods. 支持匿名访问 PostMapping
+ *
+ * @see AnonymousGetMapping
+ * @see AnonymousPostMapping
+ * @see AnonymousPutMapping
+ * @see AnonymousDeleteMapping
+ * @see RequestMapping
+ */
+@AnonymousAccess
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@RequestMapping(method = RequestMethod.POST)
+public @interface AnonymousPostMapping {
+
+ /**
+ * Alias for {@link RequestMapping#name}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String name() default "";
+
+ /**
+ * Alias for {@link RequestMapping#value}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] value() default {};
+
+ /**
+ * Alias for {@link RequestMapping#path}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] path() default {};
+
+ /**
+ * Alias for {@link RequestMapping#params}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] params() default {};
+
+ /**
+ * Alias for {@link RequestMapping#headers}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
+
+ /**
+ * Alias for {@link RequestMapping#consumes}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
+
+ /**
+ * Alias for {@link RequestMapping#produces}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPutMapping.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPutMapping.java
index a4165183..9641f8d0 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPutMapping.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/annotation/AnonymousPutMapping.java
@@ -1,75 +1,75 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.annotation;
-
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import java.lang.annotation.*;
-
-/**
- * Annotation for mapping HTTP {@code PUT} requests onto specific handler methods. 支持匿名访问 PutMapping
- *
- * @see AnonymousGetMapping
- * @see AnonymousPostMapping
- * @see AnonymousPutMapping
- * @see AnonymousDeleteMapping
- * @see RequestMapping
- */
-@AnonymousAccess
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@RequestMapping(method = RequestMethod.PUT)
-public @interface AnonymousPutMapping {
-
- /**
- * Alias for {@link RequestMapping#name}.
- */
- @AliasFor(annotation = RequestMapping.class) String name() default "";
-
- /**
- * Alias for {@link RequestMapping#value}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] value() default {};
-
- /**
- * Alias for {@link RequestMapping#path}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] path() default {};
-
- /**
- * Alias for {@link RequestMapping#params}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] params() default {};
-
- /**
- * Alias for {@link RequestMapping#headers}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
-
- /**
- * Alias for {@link RequestMapping#consumes}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
-
- /**
- * Alias for {@link RequestMapping#produces}.
- */
- @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
-
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.annotation;
+
+import org.springframework.core.annotation.AliasFor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation for mapping HTTP {@code PUT} requests onto specific handler methods. 支持匿名访问 PutMapping
+ *
+ * @see AnonymousGetMapping
+ * @see AnonymousPostMapping
+ * @see AnonymousPutMapping
+ * @see AnonymousDeleteMapping
+ * @see RequestMapping
+ */
+@AnonymousAccess
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@RequestMapping(method = RequestMethod.PUT)
+public @interface AnonymousPutMapping {
+
+ /**
+ * Alias for {@link RequestMapping#name}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String name() default "";
+
+ /**
+ * Alias for {@link RequestMapping#value}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] value() default {};
+
+ /**
+ * Alias for {@link RequestMapping#path}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] path() default {};
+
+ /**
+ * Alias for {@link RequestMapping#params}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] params() default {};
+
+ /**
+ * Alias for {@link RequestMapping#headers}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] headers() default {};
+
+ /**
+ * Alias for {@link RequestMapping#consumes}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {};
+
+ /**
+ * Alias for {@link RequestMapping#produces}.
+ */
+ @AliasFor(annotation = RequestMapping.class) String[] produces() default {};
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsArgs.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsArgs.java
index 424a0e53..5ade5ddd 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsArgs.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsArgs.java
@@ -1,43 +1,44 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * 通用参数
- *
- * @author odboy
- * @date 2025-07-23
- */
-public class CsArgs {
- @Getter
- @Setter
- public static class FindByLongId extends CsObject {
- @NotNull(message = "id必填")
- private Long id;
- }
-
- @Getter
- @Setter
- public static class DeleteById extends CsObject {
- @NotNull(message = "id必填")
- private Long id;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 通用参数
+ *
+ * @author odboy
+ * @date 2025-07-23
+ */
+public class CsArgs {
+ @Getter
+ @Setter
+ public static class FindByLongId extends CsObject {
+ @NotNull(message = "id必填")
+ private Long id;
+ }
+
+ @Getter
+ @Setter
+ public static class DeleteById extends CsObject {
+ @NotNull(message = "id必填")
+ private Long id;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseCreateTimeTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseCreateTimeTb.java
index 86c29d44..7ae782cb 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseCreateTimeTb.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseCreateTimeTb.java
@@ -1,34 +1,35 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-@Getter
-@Setter
-@EqualsAndHashCode(callSuper = false)
-public class CsBaseCreateTimeTb extends CsObject {
- @TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date createTime;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CsBaseCreateTimeTb extends CsObject {
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date createTime;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseTimeTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseTimeTb.java
index 4cc8f340..fc21838a 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseTimeTb.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseTimeTb.java
@@ -1,38 +1,39 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-@Getter
-@Setter
-@EqualsAndHashCode(callSuper = false)
-public class CsBaseTimeTb extends CsObject {
- @TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date createTime;
-
- @TableField(fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date updateTime;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CsBaseTimeTb extends CsObject {
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date updateTime;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUpdateTimeTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUpdateTimeTb.java
index f3fab884..0eb541b9 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUpdateTimeTb.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUpdateTimeTb.java
@@ -1,34 +1,35 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-@Getter
-@Setter
-@EqualsAndHashCode(callSuper = false)
-public class CsBaseUpdateTimeTb extends CsObject {
- @TableField(fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date updateTime;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CsBaseUpdateTimeTb extends CsObject {
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date updateTime;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserCreateTimeTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserCreateTimeTb.java
new file mode 100644
index 00000000..409da2df
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserCreateTimeTb.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.data.annotation.CreatedBy;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CsBaseUserCreateTimeTb extends CsObject {
+
+ @CreatedBy
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建人", hidden = true)
+ private String createBy;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date createTime;
+
+ /* 分组校验 */
+ public @interface Create {
+ }
+
+ /* 分组校验 */
+ public @interface Update {
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder builder = new ToStringBuilder(this);
+ Field[] fields = this.getClass().getDeclaredFields();
+ try {
+ for (Field f : fields) {
+ f.setAccessible(true);
+ builder.append(f.getName(), f.get(this)).append("\n");
+ }
+ } catch (Exception e) {
+ builder.append("toString builder encounter an error");
+ }
+ return builder.toString();
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeLogicTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeLogicTb.java
index ef01cf84..52e81789 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeLogicTb.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeLogicTb.java
@@ -1,56 +1,57 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.data.annotation.CreatedBy;
-import org.springframework.data.annotation.LastModifiedBy;
-
-import java.util.Date;
-
-/**
- * 逻辑删除通用模型
- *
- * @author odboy
- * @date 2025-01-12
- */
-@Getter
-@Setter
-public class CsBaseUserTimeLogicTb extends CsObject {
- @CreatedBy
- @TableField(value = "create_by", fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建人", hidden = true)
- private String createBy;
- @LastModifiedBy
- @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新人", hidden = true)
- private String updateBy;
- @TableField(value = "create_time", fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建时间", hidden = true)
- private Date createTime;
- @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新时间", hidden = true)
- private Date updateTime;
- @ApiModelProperty(value = "数据有效性", hidden = true)
- @TableLogic
- @TableField("available")
- private Integer available;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.data.annotation.CreatedBy;
+import org.springframework.data.annotation.LastModifiedBy;
+
+import java.util.Date;
+
+/**
+ * 逻辑删除通用模型
+ *
+ * @author odboy
+ * @date 2025-01-12
+ */
+@Getter
+@Setter
+public class CsBaseUserTimeLogicTb extends CsObject {
+ @CreatedBy
+ @TableField(value = "create_by", fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建人", hidden = true)
+ private String createBy;
+ @LastModifiedBy
+ @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新人", hidden = true)
+ private String updateBy;
+ @TableField(value = "create_time", fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间", hidden = true)
+ private Date createTime;
+ @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间", hidden = true)
+ private Date updateTime;
+ @ApiModelProperty(value = "数据有效性", hidden = true)
+ @TableLogic
+ @TableField("available")
+ private Integer available;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeTb.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeTb.java
index fbb7837a..1646699a 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeTb.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsBaseUserTimeTb.java
@@ -1,76 +1,77 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.springframework.data.annotation.CreatedBy;
-import org.springframework.data.annotation.LastModifiedBy;
-
-import java.lang.reflect.Field;
-import java.util.Date;
-
-@Getter
-@Setter
-@EqualsAndHashCode(callSuper = false)
-public class CsBaseUserTimeTb extends CsObject {
-
- @CreatedBy
- @TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建人", hidden = true)
- private String createBy;
-
- @LastModifiedBy
- @TableField(fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新人", hidden = true)
- private String updateBy;
-
- @TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date createTime;
-
- @TableField(fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
- private Date updateTime;
-
- /* 分组校验 */
- public @interface Create {
- }
-
- /* 分组校验 */
- public @interface Update {
- }
-
- @Override
- public String toString() {
- ToStringBuilder builder = new ToStringBuilder(this);
- Field[] fields = this.getClass().getDeclaredFields();
- try {
- for (Field f : fields) {
- f.setAccessible(true);
- builder.append(f.getName(), f.get(this)).append("\n");
- }
- } catch (Exception e) {
- builder.append("toString builder encounter an error");
- }
- return builder.toString();
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.data.annotation.CreatedBy;
+import org.springframework.data.annotation.LastModifiedBy;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CsBaseUserTimeTb extends CsObject {
+
+ @CreatedBy
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建人", hidden = true)
+ private String createBy;
+
+ @LastModifiedBy
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新人", hidden = true)
+ private String updateBy;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
+ private Date updateTime;
+
+ /* 分组校验 */
+ public @interface Create {
+ }
+
+ /* 分组校验 */
+ public @interface Update {
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder builder = new ToStringBuilder(this);
+ Field[] fields = this.getClass().getDeclaredFields();
+ try {
+ for (Field f : fields) {
+ f.setAccessible(true);
+ builder.append(f.getName(), f.get(this)).append("\n");
+ }
+ } catch (Exception e) {
+ builder.append("toString builder encounter an error");
+ }
+ return builder.toString();
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsObject.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsObject.java
index 880a56ae..0b528db7 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsObject.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsObject.java
@@ -1,28 +1,29 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import java.io.Serializable;
-
-/**
- * 基础对象
- *
- * @author odboy
- * @date 2022-01-12
- */
-public class CsObject implements Serializable {
- private static final long serialVersionUID = 1L;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import java.io.Serializable;
+
+/**
+ * 基础对象
+ *
+ * @author odboy
+ * @date 2022-01-12
+ */
+public class CsObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageArgs.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageArgs.java
index fbb8955a..0bbac579 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageArgs.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageArgs.java
@@ -1,46 +1,47 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import java.io.Serializable;
-
-/**
- * 数据分页参数
- *
- * @author odboy
- * @date 2025-01-20
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class CsPageArgs implements Serializable {
- @NotNull(message = "参数page不能为空")
- @Min(value = 1, message = "参数page最小值为1")
- @ApiModelProperty(value = "页码", example = "1")
- private Integer page;
- @NotNull(message = "参数size不能为空")
- @Min(value = 1, message = "参数size最小值为1")
- @ApiModelProperty(value = "每页数据量", example = "10")
- private Integer size;
- private T args;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 数据分页参数
+ *
+ * @author odboy
+ * @date 2025-01-20
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CsPageArgs implements Serializable {
+ @NotNull(message = "参数page不能为空")
+ @Min(value = 1, message = "参数page最小值为1")
+ @ApiModelProperty(value = "页码", example = "1")
+ private Integer page;
+ @NotNull(message = "参数size不能为空")
+ @Min(value = 1, message = "参数size最小值为1")
+ @ApiModelProperty(value = "每页数据量", example = "10")
+ private Integer size;
+ private T args;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageResult.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageResult.java
index 6b42ee97..6cd09399 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageResult.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsPageResult.java
@@ -1,51 +1,52 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 结果封装类
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = false)
-public class CsPageResult extends CsObject {
- private List content;
- private long totalElements;
-
- public static CsPageResult emptyListData() {
- CsPageResult result = new CsPageResult<>();
- result.setTotalElements(0);
- result.setContent(new ArrayList<>());
- return result;
- }
-
- public static CsPageResult listData(IPage page) {
- CsPageResult result = new CsPageResult<>();
- result.setTotalElements(page.getTotal());
- result.setContent(page.getRecords());
- return result;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 结果封装类
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class CsPageResult extends CsObject {
+ private List content;
+ private long totalElements;
+
+ public static CsPageResult emptyListData() {
+ CsPageResult result = new CsPageResult<>();
+ result.setTotalElements(0);
+ result.setContent(new ArrayList<>());
+ return result;
+ }
+
+ public static CsPageResult listData(IPage page) {
+ CsPageResult result = new CsPageResult<>();
+ result.setTotalElements(page.getTotal());
+ result.setContent(page.getRecords());
+ return result;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsSelectOptionVo.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsSelectOptionVo.java
index 11e67d4d..4d8b09b0 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsSelectOptionVo.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/base/CsSelectOptionVo.java
@@ -1,37 +1,38 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.base;
-
-import lombok.*;
-
-import java.util.Map;
-
-/**
- * 元数据选项
- *
- * @author odboy
- * @date 2025-01-13
- */
-@Data
-@Builder
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = false)
-public class CsSelectOptionVo extends CsObject {
- private String label;
- private String value;
- private Map ext;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.base;
+
+import lombok.*;
+
+import java.util.Map;
+
+/**
+ * 元数据选项
+ *
+ * @author odboy
+ * @date 2025-01-13
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class CsSelectOptionVo extends CsObject {
+ private String label;
+ private String value;
+ private Map ext;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/CaptchaCodeEnum.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/CaptchaCodeEnum.java
index 230e6617..59d31da9 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/CaptchaCodeEnum.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/CaptchaCodeEnum.java
@@ -1,42 +1,43 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.constant;
-
-/**
- * 验证码配置枚举
- */
-public enum CaptchaCodeEnum {
- /**
- * 算数
- */
- ARITHMETIC,
- /**
- * 中文
- */
- CHINESE,
- /**
- * 中文闪图
- */
- CHINESE_GIF,
- /**
- * 闪图
- */
- GIF,
- /**
- * 静态
- */
- SPEC
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.constant;
+
+/**
+ * 验证码配置枚举
+ */
+public enum CaptchaCodeEnum {
+ /**
+ * 算数
+ */
+ ARITHMETIC,
+ /**
+ * 中文
+ */
+ CHINESE,
+ /**
+ * 中文闪图
+ */
+ CHINESE_GIF,
+ /**
+ * 闪图
+ */
+ GIF,
+ /**
+ * 静态
+ */
+ SPEC
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/FileTypeEnum.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/FileTypeEnum.java
index 1d5f8ddb..13409781 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/FileTypeEnum.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/FileTypeEnum.java
@@ -1,29 +1,34 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.constant;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-@Getter
-@AllArgsConstructor
-public enum FileTypeEnum {
- /* 文件类型 */
- IMAGE("image", "图片"), DOC("doc", "文档"), VOICE("voice", "音频"), VIDEO("video", "视频"), OTHER("other", "其他");
-
- private final String code;
- private final String description;
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.constant;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum FileTypeEnum {
+ /* 文件类型 */
+ IMAGE("image", "图片"),
+ DOC("doc", "文档"),
+ VOICE("voice", "音频"),
+ VIDEO("video", "视频"),
+ OTHER("other", "其他");
+
+ private final String code;
+ private final String description;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/RequestMethodEnum.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/RequestMethodEnum.java
index 06a54f6a..74b1d5a8 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/RequestMethodEnum.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/RequestMethodEnum.java
@@ -1,68 +1,69 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.constant;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-@Getter
-@AllArgsConstructor
-public enum RequestMethodEnum {
-
- /**
- * 搜寻 @AnonymousGetMapping
- */
- GET("GET"),
-
- /**
- * 搜寻 @AnonymousPostMapping
- */
- POST("POST"),
-
- /**
- * 搜寻 @AnonymousPutMapping
- */
- PUT("PUT"),
-
- /**
- * 搜寻 @AnonymousPatchMapping
- */
- PATCH("PATCH"),
-
- /**
- * 搜寻 @AnonymousDeleteMapping
- */
- DELETE("DELETE"),
-
- /**
- * 否则就是所有 Request 接口都放行
- */
- ALL("All");
-
- /**
- * Request 类型
- */
- private final String type;
-
- public static RequestMethodEnum find(String type) {
- for (RequestMethodEnum value : RequestMethodEnum.values()) {
- if (value.getType().equals(type)) {
- return value;
- }
- }
- return ALL;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.constant;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum RequestMethodEnum {
+
+ /**
+ * 搜寻 @AnonymousGetMapping
+ */
+ GET("GET"),
+
+ /**
+ * 搜寻 @AnonymousPostMapping
+ */
+ POST("POST"),
+
+ /**
+ * 搜寻 @AnonymousPutMapping
+ */
+ PUT("PUT"),
+
+ /**
+ * 搜寻 @AnonymousPatchMapping
+ */
+ PATCH("PATCH"),
+
+ /**
+ * 搜寻 @AnonymousDeleteMapping
+ */
+ DELETE("DELETE"),
+
+ /**
+ * 否则就是所有 Request 接口都放行
+ */
+ ALL("All");
+
+ /**
+ * Request 类型
+ */
+ private final String type;
+
+ public static RequestMethodEnum find(String type) {
+ for (RequestMethodEnum value : RequestMethodEnum.values()) {
+ if (value.getType().equals(type)) {
+ return value;
+ }
+ }
+ return ALL;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/SystemConst.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/SystemConst.java
index 43a499b0..b789f5b4 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/SystemConst.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/constant/SystemConst.java
@@ -1,52 +1,53 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.constant;
-
-/**
- * 常用静态常量
- */
-public interface SystemConst {
- /**
- * win 系统
- */
- String WIN = "win";
-
- /**
- * mac 系统
- */
- String MAC = "mac";
-
- /**
- * 请求头名称
- */
- String HEADER_NAME = "Authorization";
-
- /**
- * Token前缀
- */
- String TOKEN_PREFIX = "Bearer";
-
- /**
- * 小数点
- */
- String SYMBOL_DOT = ".";
- String SYMBOL_EQUAL = "=";
- String SYMBOL_ADD = "+";
- String SYMBOL_SUBTRACT = "-";
- String SYMBOL_AT = "@";
- String PROPERTY_OS_NAME = "os.name";
- String OS_NAME_WINDOWS = "Windows";
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.constant;
+
+/**
+ * 常用静态常量
+ */
+public interface SystemConst {
+ /**
+ * win 系统
+ */
+ String WIN = "win";
+
+ /**
+ * mac 系统
+ */
+ String MAC = "mac";
+
+ /**
+ * 请求头名称
+ */
+ String HEADER_NAME = "Authorization";
+
+ /**
+ * Token前缀
+ */
+ String TOKEN_PREFIX = "Bearer";
+
+ /**
+ * 小数点
+ */
+ String SYMBOL_DOT = ".";
+ String SYMBOL_EQUAL = "=";
+ String SYMBOL_ADD = "+";
+ String SYMBOL_SUBTRACT = "-";
+ String SYMBOL_AT = "@";
+ String PROPERTY_OS_NAME = "os.name";
+ String OS_NAME_WINDOWS = "Windows";
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BeanLoadFinishListener.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BeanLoadFinishListener.java
index 1b600aca..02865ec7 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BeanLoadFinishListener.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BeanLoadFinishListener.java
@@ -1,36 +1,37 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.context;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextRefreshedEvent;
-import org.springframework.stereotype.Component;
-
-/**
- * Bean加载完毕 监听
- *
- * @author odboy
- * @date 2025-01-16
- */
-@Slf4j
-@Component
-public class BeanLoadFinishListener implements ApplicationListener {
- @Override
- public void onApplicationEvent(ContextRefreshedEvent event) {
- log.info("所有的Bean都加载完毕了");
- }
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.context;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.event.ContextRefreshedEvent;
+import org.springframework.stereotype.Component;
+
+/**
+ * Bean加载完毕 监听
+ *
+ * @author odboy
+ * @date 2025-01-16
+ */
+@Slf4j
+@Component
+public class BeanLoadFinishListener implements ApplicationListener {
+ @Override
+ public void onApplicationEvent(ContextRefreshedEvent event) {
+ log.info("所有的Bean都加载完毕了");
+ }
}
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BootApplication.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BootApplication.java
index 6ad014b6..56cd9900 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BootApplication.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/BootApplication.java
@@ -1,48 +1,54 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.context;
-
-import cn.hutool.core.util.StrUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.env.Environment;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * 主要目的是输出应用的服务地址
- *
- * @author odboy
- * @date 2024-04-20
- */
-@Slf4j
-public class BootApplication {
- @Bean
- public CsSpringBeanHolder springBeanHolder() {
- return new CsSpringBeanHolder();
- }
-
- protected static void inited(ConfigurableApplicationContext application) throws UnknownHostException {
- Environment env = application.getEnvironment();
- String ip = InetAddress.getLocalHost().getHostAddress();
- String port = env.getProperty("server.port");
- String path = StrUtil.isEmpty(env.getProperty("config.servlet.context-path")) ? "" : env.getProperty("config.servlet.context-path");
- log.info(
- "\n----------------------------------------------------------\n\t" + "Application is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path + "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n\t" + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + "----------------------------------------------------------");
- }
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.context;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.core.env.Environment;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * 主要目的是输出应用的服务地址
+ *
+ * @author odboy
+ * @date 2024-04-20
+ */
+@Slf4j
+public class BootApplication {
+ @Bean
+ public CsSpringBeanHolder springBeanHolder() {
+ return new CsSpringBeanHolder();
+ }
+
+ protected static void inited(ConfigurableApplicationContext application) throws UnknownHostException {
+ Environment env = application.getEnvironment();
+ String ip = InetAddress.getLocalHost().getHostAddress();
+ String port = env.getProperty("server.port");
+ String path = StrUtil.isEmpty(env.getProperty("config.servlet.context-path")) ?
+ "" :
+ env.getProperty("config.servlet.context-path");
+ log.info(
+ "\n----------------------------------------------------------\n\t" +
+ "Application is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
+ "External: \thttp://" + ip + ":" + port + path + "/\n\t" + "Swagger文档: \thttp://" + ip + ":" + port +
+ path + "/doc.html\n" + "----------------------------------------------------------");
+ }
}
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsRequestHolder.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsRequestHolder.java
index ef0d6de6..7badbaad 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsRequestHolder.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsRequestHolder.java
@@ -1,17 +1,34 @@
-package cn.odboy.framework.context;
-
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Objects;
-
-/**
- * 获取 HttpServletRequest
- */
-public class CsRequestHolder {
-
- public static HttpServletRequest getHttpServletRequest() {
- return ((ServletRequestAttributes)Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
- }
-}
+
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.context;
+
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Objects;
+
+/**
+ * 获取 HttpServletRequest
+ */
+public class CsRequestHolder {
+
+ public static HttpServletRequest getHttpServletRequest() {
+ return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsScriptHelper.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsScriptHelper.java
index d35b5b6b..cc0dee77 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsScriptHelper.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsScriptHelper.java
@@ -1,98 +1,63 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.context;
-
-import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.script.ScriptRuntimeException;
-import cn.odboy.framework.exception.BadRequestException;
-import org.springframework.stereotype.Component;
-
-import javax.script.*;
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * 脚本工具
- *
- * @author odboy
- * @date 2023-12-05
- */
-@Component
-public class CsScriptHelper {
- private static final String FUNCTION_TAG = "function";
- private final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
-
- /**
- * @param script 函数表达式
- * @return 返回值
- */
- public Object evalObj(String script, Object compareObj) {
- try {
- if (script.contains(FUNCTION_TAG)) {
- throw new BadRequestException("script格式异常");
- }
- // 构建一个不同的脚本上下文
- ScriptContext newContext = new SimpleScriptContext();
- if (compareObj != null) {
- Field[] fields = ReflectUtil.getFields(compareObj.getClass());
- Map filedNameValueMap = new HashMap<>(3);
- Arrays.stream(fields).parallel().forEach(f -> filedNameValueMap.put(f.getName(), ReflectUtil.getFieldValue(compareObj, f)));
- Set> entries = filedNameValueMap.entrySet();
- long count = entries.stream().filter(f -> f.getValue() != null).count();
- if (count == 0) {
- throw new BadRequestException("比较对象中没有有效值");
- }
- Bindings engineScope = engine.createBindings();
- entries.forEach(f -> {
- // 在新的执行引擎作用域中添加与上面相同名称的变量
- engineScope.put(f.getKey(), f.getValue());
- });
- newContext.setBindings(engineScope, ScriptContext.ENGINE_SCOPE);
- }
- // 执行脚本, 注意这里指定新的执行作用域上下文
- return engine.eval(script, newContext);
- } catch (ScriptException e) {
- throw new ScriptRuntimeException(e);
- }
- }
-
- /**
- * @param script 函数表达式, 例如: function hello(name) { print('Hello, ' + name); }
- * @param functionName 函数名称, 例如: "hello"
- * @param args 函数参数, 例如: "小明"
- * @return 返回值
- */
- public Object evalFunction(String script, String functionName, Object... args) {
- if (!script.contains(FUNCTION_TAG)) {
- throw new BadRequestException("script格式异常");
- }
- try {
- // 执行脚本
- engine.eval(script);
- // 由ScriptEngines实现的接口, 其方法允许调用以前已执行的脚本中的过程。
- Invocable inv = (Invocable)engine;
- // 调用全局函数, 并传入参数
- return inv.invokeFunction(functionName, args);
- } catch (ScriptException e) {
- throw new ScriptRuntimeException(e);
- } catch (NoSuchMethodException e) {
- throw new ScriptRuntimeException(e);
- }
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.context;
+
+import lombok.extern.slf4j.Slf4j;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Scriptable;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 脚本工具
+ *
+ * @author odboy
+ * @date 2025-09-23
+ */
+@Slf4j
+@Component
+public class CsScriptHelper {
+ public Object evalObj(String script, Map args) {
+ try (Context rhino = Context.enter()) {
+ Scriptable scope = rhino.initStandardObjects();
+ bindArgumentsToScope(scope, args);
+ Object result = rhino.evaluateString(scope, script, "JavaScript", 1, null);
+ log.info("执行结果: {}", Context.toString(result));
+ return result;
+ }
+ }
+
+ private void bindArgumentsToScope(Scriptable scope, Map, ?> args) {
+ if (args == null) {
+ return;
+ }
+ for (Map.Entry, ?> entry : args.entrySet()) {
+ Object jsValue = Context.javaToJS(entry.getValue(), scope);
+ scope.put(entry.getKey().toString(), scope, jsValue);
+ }
+ }
+
+ private void bindArgumentsToScope(Scriptable scope, Object args) {
+ if (args == null) {
+ return;
+ }
+ // 单个对象参数
+ Object jsValue = Context.javaToJS(args, scope);
+ scope.put("args", scope, jsValue);
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsSpringBeanHolder.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsSpringBeanHolder.java
index e97de286..071905e3 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsSpringBeanHolder.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/context/CsSpringBeanHolder.java
@@ -1,169 +1,172 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.context;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-@Slf4j
-@SuppressWarnings({"unchecked", "all"})
-public class CsSpringBeanHolder implements ApplicationContextAware, DisposableBean {
-
- private static ApplicationContext applicationContext = null;
- private static final List CALL_BACKS = new ArrayList<>();
- private static boolean addCallback = true;
-
- /**
- * 针对 某些初始化方法, 在SpringContextHolder 未初始化时 提交回调方法。 在SpringContextHolder 初始化后, 进行回调使用
- *
- * @param callBack 回调函数
- */
- public synchronized static void addCallBacks(CallBack callBack) {
- if (addCallback) {
- CsSpringBeanHolder.CALL_BACKS.add(callBack);
- } else {
- log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName());
- callBack.executor();
- }
- }
-
- /**
- * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
- */
- public static T getBean(String name) {
- assertContextInjected();
- return (T)applicationContext.getBean(name);
- }
-
- /**
- * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
- */
- public static T getBean(Class requiredType) {
- assertContextInjected();
- return applicationContext.getBean(requiredType);
- }
-
- /**
- * 获取SpringBoot 配置信息
- *
- * @param property 属性key
- * @param defaultValue 默认值
- * @param requiredType 返回类型
- * @return /
- */
- public static T getProperties(String property, T defaultValue, Class requiredType) {
- T result = defaultValue;
- try {
- result = getBean(Environment.class).getProperty(property, requiredType);
- } catch (Exception ignored) {
- }
- return result;
- }
-
- /**
- * 获取SpringBoot 配置信息
- *
- * @param property 属性key
- * @return /
- */
- public static String getProperties(String property) {
- return getProperties(property, null, String.class);
- }
-
- /**
- * 获取SpringBoot 配置信息
- *
- * @param property 属性key
- * @param requiredType 返回类型
- * @return /
- */
- public static T getProperties(String property, Class requiredType) {
- return getProperties(property, null, requiredType);
- }
-
- /**
- * 检查ApplicationContext不为空.
- */
- private static void assertContextInjected() {
- if (applicationContext == null) {
- throw new IllegalStateException(
- "applicaitonContext属性未注入, 请在applicationContext" + ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
- }
- }
-
- /**
- * 清除SpringContextHolder中的ApplicationContext为Null.
- */
- private static void clearHolder() {
- log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
- applicationContext = null;
- }
-
- @Override
- public void destroy() {
- CsSpringBeanHolder.clearHolder();
- }
-
- @Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- if (CsSpringBeanHolder.applicationContext != null) {
- log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + CsSpringBeanHolder.applicationContext);
- }
- CsSpringBeanHolder.applicationContext = applicationContext;
- if (addCallback) {
- for (CallBack callBack : CsSpringBeanHolder.CALL_BACKS) {
- callBack.executor();
- }
- CALL_BACKS.clear();
- }
- CsSpringBeanHolder.addCallback = false;
- }
-
- /**
- * 获取 @Service 的所有 bean 名称
- *
- * @return /
- */
- public static List getAllServiceBeanName() {
- return new ArrayList<>(Arrays.asList(applicationContext.getBeanNamesForAnnotation(Service.class)));
- }
-
- interface CallBack {
-
- /**
- * 回调执行方法
- */
- void executor();
-
- /**
- * 本回调任务名称
- *
- * @return /
- */
- default String getCallBackName() {
- return Thread.currentThread().getId() + ":" + this.getClass().getName();
- }
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.context;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Slf4j
+@SuppressWarnings({"unchecked", "all"})
+public class CsSpringBeanHolder implements ApplicationContextAware, DisposableBean {
+
+ private static ApplicationContext applicationContext = null;
+ private static final List CALL_BACKS = new ArrayList<>();
+ private static boolean addCallback = true;
+
+ /**
+ * 针对 某些初始化方法, 在SpringContextHolder 未初始化时 提交回调方法。 在SpringContextHolder 初始化后, 进行回调使用
+ *
+ * @param callBack 回调函数
+ */
+ public synchronized static void addCallBacks(CallBack callBack) {
+ if (addCallback) {
+ CsSpringBeanHolder.CALL_BACKS.add(callBack);
+ } else {
+ log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName());
+ callBack.executor();
+ }
+ }
+
+ /**
+ * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+ */
+ public static T getBean(String name) {
+ assertContextInjected();
+ return (T) applicationContext.getBean(name);
+ }
+
+ /**
+ * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+ */
+ public static T getBean(Class requiredType) {
+ assertContextInjected();
+ return applicationContext.getBean(requiredType);
+ }
+
+ /**
+ * 获取SpringBoot 配置信息
+ *
+ * @param property 属性key
+ * @param defaultValue 默认值
+ * @param requiredType 返回类型
+ * @return /
+ */
+ public static T getProperties(String property, T defaultValue, Class requiredType) {
+ T result = defaultValue;
+ try {
+ result = getBean(Environment.class).getProperty(property, requiredType);
+ } catch (Exception ignored) {
+ }
+ return result;
+ }
+
+ /**
+ * 获取SpringBoot 配置信息
+ *
+ * @param property 属性key
+ * @return /
+ */
+ public static String getProperties(String property) {
+ return getProperties(property, null, String.class);
+ }
+
+ /**
+ * 获取SpringBoot 配置信息
+ *
+ * @param property 属性key
+ * @param requiredType 返回类型
+ * @return /
+ */
+ public static T getProperties(String property, Class requiredType) {
+ return getProperties(property, null, requiredType);
+ }
+
+ /**
+ * 检查ApplicationContext不为空.
+ */
+ private static void assertContextInjected() {
+ if (applicationContext == null) {
+ throw new IllegalStateException(
+ "applicaitonContext属性未注入, 请在applicationContext" +
+ ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
+ }
+ }
+
+ /**
+ * 清除SpringContextHolder中的ApplicationContext为Null.
+ */
+ private static void clearHolder() {
+ log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
+ applicationContext = null;
+ }
+
+ @Override
+ public void destroy() {
+ CsSpringBeanHolder.clearHolder();
+ }
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ if (CsSpringBeanHolder.applicationContext != null) {
+ log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" +
+ CsSpringBeanHolder.applicationContext);
+ }
+ CsSpringBeanHolder.applicationContext = applicationContext;
+ if (addCallback) {
+ for (CallBack callBack : CsSpringBeanHolder.CALL_BACKS) {
+ callBack.executor();
+ }
+ CALL_BACKS.clear();
+ }
+ CsSpringBeanHolder.addCallback = false;
+ }
+
+ /**
+ * 获取 @Service 的所有 bean 名称
+ *
+ * @return /
+ */
+ public static List getAllServiceBeanName() {
+ return new ArrayList<>(Arrays.asList(applicationContext.getBeanNamesForAnnotation(Service.class)));
+ }
+
+ interface CallBack {
+
+ /**
+ * 回调执行方法
+ */
+ void executor();
+
+ /**
+ * 本回调任务名称
+ *
+ * @return /
+ */
+ default String getCallBackName() {
+ return Thread.currentThread().getId() + ":" + this.getClass().getName();
+ }
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/doc/SwaggerConfig.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/doc/SwaggerConfig.java
index c5abc355..76708601 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/doc/SwaggerConfig.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/doc/SwaggerConfig.java
@@ -1,143 +1,154 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.doc;
-
-import cn.odboy.constant.SystemConst;
-import cn.odboy.framework.properties.AppProperties;
-import cn.odboy.util.CsAnonTagUtil;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.ReflectionUtils;
-import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.service.*;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spi.service.contexts.SecurityContext;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
-import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * api页面 /doc.html
- */
-@Configuration
-@EnableSwagger2
-public class SwaggerConfig {
- @Value("${server.servlet.context-path:}")
- private String apiPath;
- @Autowired
- private AppProperties properties;
- @Autowired
- private ApplicationContext applicationContext;
-
- @Bean
- public Docket createRestApi() {
- return new Docket(DocumentationType.SWAGGER_2).enable(properties.getSwagger().getEnabled()).pathMapping("/").apiInfo(apiInfo()).select()
- .paths(PathSelectors.regex("^(?!/error).*")).paths(PathSelectors.any()).build()
- //添加登陆认证
- .securitySchemes(securitySchemes()).securityContexts(securityContexts());
- }
-
- private ApiInfo apiInfo() {
- return new ApiInfoBuilder().description("一个简单且易上手的 Spring boot 后台管理框架").title("CuteJava 接口文档").version("1.4.1").build();
- }
-
- private List securitySchemes() {
- //设置请求头信息
- List securitySchemes = new ArrayList<>();
- ApiKey apiKey = new ApiKey(SystemConst.HEADER_NAME, SystemConst.HEADER_NAME, "header");
- securitySchemes.add(apiKey);
- return securitySchemes;
- }
-
- private List securityContexts() {
- //设置需要登录认证的路径
- List securityContexts = new ArrayList<>();
- securityContexts.add(getContextByPath());
- return securityContexts;
- }
-
- private SecurityContext getContextByPath() {
- Set urls = CsAnonTagUtil.getAllAnonymousUrl(applicationContext);
- urls = urls.stream().filter(url -> !"/".equals(url)).collect(Collectors.toSet());
- String regExp = "^(?!" + apiPath + String.join("|" + apiPath, urls) + ").*$";
- return SecurityContext.builder().securityReferences(defaultAuth()).operationSelector(o -> o.requestMappingPattern()
- // 排除不需要认证的接口
- .matches(regExp)).build();
- }
-
- private List defaultAuth() {
- List securityReferences = new ArrayList<>();
- AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
- AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
- authorizationScopes[0] = authorizationScope;
- securityReferences.add(new SecurityReference(SystemConst.HEADER_NAME, authorizationScopes));
- return securityReferences;
- }
-
- /**
- * 解决Springfox与SpringBoot集成后, WebMvcRequestHandlerProvider和WebFluxRequestHandlerProvider冲突问题
- *
- * @return /
- */
- @Bean
- @SuppressWarnings({"unchecked", "all"})
- public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
- return new BeanPostProcessor() {
-
- @Override
- public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
- if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
- customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
- }
- return bean;
- }
-
- private void customizeSpringfoxHandlerMappings(List mappings) {
- List filteredMappings = mappings.stream().filter(mapping -> mapping.getPatternParser() == null).collect(Collectors.toList());
- mappings.clear();
- mappings.addAll(filteredMappings);
- }
-
- private List getHandlerMappings(Object bean) {
- Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
- if (field != null) {
- field.setAccessible(true);
- try {
- return (List)field.get(bean);
- } catch (IllegalAccessException e) {
- throw new IllegalStateException("Failed to access handlerMappings field", e);
- }
- }
- return Collections.emptyList();
- }
- };
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.doc;
+
+import cn.odboy.constant.SystemConst;
+import cn.odboy.framework.properties.AppProperties;
+import cn.odboy.util.CsAnonTagUtil;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.ReflectionUtils;
+import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.service.*;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
+import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * api页面 /doc.html
+ */
+@Configuration
+@EnableSwagger2
+public class SwaggerConfig {
+ @Value("${server.servlet.context-path:}")
+ private String apiPath;
+ @Autowired
+ private AppProperties properties;
+ @Autowired
+ private ApplicationContext applicationContext;
+
+ @Bean
+ public Docket createRestApi() {
+ return new Docket(DocumentationType.SWAGGER_2).enable(properties.getSwagger().getEnabled())
+ .pathMapping("/")
+ .apiInfo(apiInfo())
+ .select()
+ .paths(PathSelectors.regex("^(?!/error).*"))
+ .paths(PathSelectors.any())
+ .build()
+ //添加登陆认证
+ .securitySchemes(securitySchemes())
+ .securityContexts(securityContexts());
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder().description("一个简单且易上手的自动化运维平台")
+ .title("CuteJava 接口文档")
+ .version("1.4.1")
+ .build();
+ }
+
+ private List securitySchemes() {
+ //设置请求头信息
+ List securitySchemes = new ArrayList<>();
+ ApiKey apiKey = new ApiKey(SystemConst.HEADER_NAME, SystemConst.HEADER_NAME, "header");
+ securitySchemes.add(apiKey);
+ return securitySchemes;
+ }
+
+ private List securityContexts() {
+ //设置需要登录认证的路径
+ List securityContexts = new ArrayList<>();
+ securityContexts.add(getContextByPath());
+ return securityContexts;
+ }
+
+ private SecurityContext getContextByPath() {
+ Set urls = CsAnonTagUtil.getAllAnonymousUrl(applicationContext);
+ urls = urls.stream().filter(url -> !"/".equals(url)).collect(Collectors.toSet());
+ String regExp = "^(?!" + apiPath + String.join("|" + apiPath, urls) + ").*$";
+ return SecurityContext.builder().securityReferences(defaultAuth()).operationSelector(o -> o.requestMappingPattern()
+ // 排除不需要认证的接口
+ .matches(regExp)).build();
+ }
+
+ private List defaultAuth() {
+ List securityReferences = new ArrayList<>();
+ AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
+ AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+ authorizationScopes[0] = authorizationScope;
+ securityReferences.add(new SecurityReference(SystemConst.HEADER_NAME, authorizationScopes));
+ return securityReferences;
+ }
+
+ /**
+ * 解决Springfox与SpringBoot集成后, WebMvcRequestHandlerProvider和WebFluxRequestHandlerProvider冲突问题
+ *
+ * @return /
+ */
+ @Bean
+ @SuppressWarnings({"unchecked", "all"})
+ public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
+ return new BeanPostProcessor() {
+
+ @Override
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
+ customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
+ }
+ return bean;
+ }
+
+ private void customizeSpringfoxHandlerMappings(List mappings) {
+ List filteredMappings =
+ mappings.stream().filter(mapping -> mapping.getPatternParser() == null).collect(Collectors.toList());
+ mappings.clear();
+ mappings.addAll(filteredMappings);
+ }
+
+ private List getHandlerMappings(Object bean) {
+ Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
+ if (field != null) {
+ field.setAccessible(true);
+ try {
+ return (List) field.get(bean);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException("Failed to access handlerMappings field", e);
+ }
+ }
+ return Collections.emptyList();
+ }
+ };
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/BadRequestException.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/BadRequestException.java
deleted file mode 100644
index 82e80836..00000000
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/BadRequestException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.exception;
-
-import lombok.Getter;
-import org.springframework.http.HttpStatus;
-
-import static org.springframework.http.HttpStatus.BAD_REQUEST;
-
-/**
- * 统一异常处理
- */
-@Getter
-public class BadRequestException extends RuntimeException {
-
- private Integer status = BAD_REQUEST.value();
-
- public BadRequestException(String msg) {
- super(msg);
- }
-
- public BadRequestException(HttpStatus status, String msg) {
- super(msg);
- this.status = status.value();
- }
-}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/ApiError.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/ApiError.java
deleted file mode 100644
index 0c6479af..00000000
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/ApiError.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.exception.handler;
-
-import lombok.Data;
-
-@Data
-public final class ApiError {
-
- private Integer status = 400;
- private Long timestamp;
- private String message;
-
- private ApiError() {
- timestamp = System.currentTimeMillis();
- }
-
- public static ApiError error(final String message) {
- ApiError apiError = new ApiError();
- apiError.setMessage(message);
- return apiError;
- }
-
- public static ApiError error(final Integer status, final String message) {
- ApiError apiError = new ApiError();
- apiError.setStatus(status);
- apiError.setMessage(message);
- return apiError;
- }
-}
-
-
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdApiExceptionCatch.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdApiExceptionCatch.java
new file mode 100644
index 00000000..e7752f43
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdApiExceptionCatch.java
@@ -0,0 +1,50 @@
+// /*
+// * Copyright 2021-2025 Odboy
+// *
+// * 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 cn.odboy.framework.exception.thirdapi;
+//
+// import java.lang.annotation.Documented;
+// import java.lang.annotation.ElementType;
+// import java.lang.annotation.Inherited;
+// import java.lang.annotation.Retention;
+// import java.lang.annotation.RetentionPolicy;
+// import java.lang.annotation.Target;
+//
+// /**
+// * 用于捕捉三方异常
+// *
+// * @author odboy
+// */
+// @Inherited
+// @Documented
+// @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
+// @Retention(RetentionPolicy.RUNTIME)
+// public @interface ThirdApiExceptionCatch {
+// /**
+// * 模块名称
+// */
+// String modelName();
+//
+// /**
+// * 接口描述
+// */
+// String description();
+//
+// /**
+// * 是否抛出异常
+// */
+// boolean throwException() default true;
+// }
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdExceptionCatchAspect.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdExceptionCatchAspect.java
new file mode 100644
index 00000000..e6aeae41
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/ThirdExceptionCatchAspect.java
@@ -0,0 +1,148 @@
+// /*
+// * Copyright 2021-2025 Odboy
+// *
+// * 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 cn.odboy.framework.exception.thirdapi;
+//
+// import cn.hutool.core.date.TimeInterval;
+// import cn.odboy.framework.exception.thirdapi.vo.KubernetesApiExceptionVo;
+// import cn.odboy.framework.exception.web.BadRequestException;
+// import cn.odboy.util.CsReturnValueHandleUtil;
+// import cn.odboy.util.LogFmtUtil;
+// import com.alibaba.fastjson2.JSON;
+// import com.aliyun.tea.TeaException;
+// import io.kubernetes.client.openapi.ApiException;
+// import lombok.extern.slf4j.Slf4j;
+// import org.aspectj.lang.ProceedingJoinPoint;
+// import org.aspectj.lang.annotation.Around;
+// import org.aspectj.lang.annotation.Aspect;
+// import org.gitlab4j.api.GitLabApiException;
+// import org.springframework.stereotype.Component;
+//
+// /**
+// * DingtalkApi调用异常
+// *
+// * @author odboy
+// * @date 2025-05-07
+// */
+// @Slf4j
+// @Aspect
+// @Component
+// public class ThirdExceptionCatchAspect {
+// @Around("@annotation(thirdApiExceptionCatch)")
+// public Object aroundDingtalkApiExceptionCatch(ProceedingJoinPoint joinPoint, ThirdApiExceptionCatch thirdApiExceptionCatch) throws Throwable {
+// return handleThirdApiException(joinPoint, thirdApiExceptionCatch);
+// }
+//
+// /**
+// * 三方服务调用异常处理
+// */
+// private Object handleThirdApiException(ProceedingJoinPoint joinPoint, ThirdApiExceptionCatch annotation) {
+// if ("dingtalk".equals(annotation.modelName())) {
+// return handleDingtalkApiException(joinPoint, annotation);
+// }
+// if ("gitlab".equals(annotation.modelName())) {
+// return handleGitlabApiException(joinPoint, annotation);
+// }
+// if ("kubernetes".equals(annotation.modelName())) {
+// return handleKubernetesApiException(joinPoint, annotation);
+// }
+// return null;
+// }
+//
+// private Object handleDingtalkApiException(ProceedingJoinPoint joinPoint, ThirdApiExceptionCatch annotation) {
+// TimeInterval timeInterval = new TimeInterval();
+// try {
+// Object result = joinPoint.proceed();
+// log.info("接口 [{}] 执行耗时: {} ms", annotation.description(), timeInterval.intervalMs());
+// return result;
+// } catch (TeaException teaException) {
+// if (!com.aliyun.teautil.Common.empty(teaException.code) && !com.aliyun.teautil.Common.empty(teaException.message)) {
+// String exceptionMessage = annotation.description() + "失败, code={}, message={}";
+// log.error(exceptionMessage, teaException.code, teaException.message, teaException);
+// if (annotation.throwException()) {
+// throw new BadRequestException(LogFmtUtil.format(exceptionMessage, teaException.code, teaException.message));
+// }
+// }
+// String exceptionMessage = annotation.description() + "失败";
+// log.error(exceptionMessage, teaException);
+// if (annotation.throwException()) {
+// throw new BadRequestException(exceptionMessage);
+// }
+// } catch (Throwable exception) {
+// TeaException err = new TeaException(exception.getMessage(), exception);
+// if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
+// String exceptionMessage = annotation.description() + "失败, code={}, message={}";
+// log.error(exceptionMessage, err.code, err.message, err);
+// if (annotation.throwException()) {
+// throw new BadRequestException(LogFmtUtil.format(exceptionMessage, err.code, err.message));
+// }
+// }
+// String exceptionMessage = annotation.description() + "失败";
+// log.error(exceptionMessage, exception);
+// if (annotation.throwException()) {
+// throw new BadRequestException(exceptionMessage);
+// }
+// }
+// return CsReturnValueHandleUtil.getDefaultValue(joinPoint);
+// }
+//
+// private Object handleGitlabApiException(ProceedingJoinPoint joinPoint, ThirdApiExceptionCatch annotation) {
+// TimeInterval timeInterval = new TimeInterval();
+// try {
+// Object result = joinPoint.proceed();
+// log.info("接口 [{}] 执行耗时: {} ms", annotation.description(), timeInterval.intervalMs());
+// return result;
+// } catch (GitLabApiException gitLabApiException) {
+// String exceptionMessage = annotation.description() + "失败,原因:" + gitLabApiException.getMessage();
+// log.error(exceptionMessage, gitLabApiException);
+// if (annotation.throwException()) {
+// throw new BadRequestException(exceptionMessage);
+// }
+// } catch (Throwable exception) {
+// String exceptionMessage = annotation.description() + "失败";
+// log.error(exceptionMessage, exception);
+// if (annotation.throwException()) {
+// throw new BadRequestException(exceptionMessage);
+// }
+// }
+// return CsReturnValueHandleUtil.getDefaultValue(joinPoint);
+// }
+//
+// private Object handleKubernetesApiException(ProceedingJoinPoint joinPoint, ThirdApiExceptionCatch annotation) {
+// TimeInterval timeInterval = new TimeInterval();
+// try {
+// Object result = joinPoint.proceed();
+// log.info("接口 [{}] 执行耗时: {} ms", annotation.description(), timeInterval.intervalMs());
+// return result;
+// } catch (ApiException e) {
+// String responseBody = e.getResponseBody();
+// log.error("接口 [{}] 执行异常,耗时: {} ms,异常信息: {}", annotation.description(), timeInterval.intervalMs(), responseBody, e);
+// if (annotation.throwException()) {
+// KubernetesApiExceptionVo actionExceptionBody = JSON.parseObject(responseBody, KubernetesApiExceptionVo.class);
+// if (actionExceptionBody != null) {
+// throw new BadRequestException(annotation.description() + "失败, 原因:" + actionExceptionBody.getReason());
+// }
+// throw new BadRequestException(annotation.description() + "失败");
+// }
+// } catch (Throwable e) {
+// log.error("接口 [{}] 执行异常,耗时: {} ms", annotation.description(), timeInterval.intervalMs(), e);
+// if (annotation.throwException()) {
+// throw new BadRequestException(annotation.description() + "失败");
+// }
+// }
+// return CsReturnValueHandleUtil.getDefaultValue(joinPoint);
+// }
+// }
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/vo/KubernetesApiExceptionVo.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/vo/KubernetesApiExceptionVo.java
new file mode 100644
index 00000000..8d16fdd4
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/thirdapi/vo/KubernetesApiExceptionVo.java
@@ -0,0 +1,46 @@
+//
+// /*
+// * Copyright 2021-2025 Odboy
+// *
+// * 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 cn.odboy.framework.exception.thirdapi.vo;
+//
+// import cn.odboy.base.CsObject;
+// import lombok.Data;
+// import lombok.EqualsAndHashCode;
+//
+// /**
+// * Kubernetes异常信息
+// *
+// * @author odboy
+// * @date 2025-08-03
+// */
+// @Data
+// @EqualsAndHashCode(callSuper = false)
+// public class KubernetesApiExceptionVo extends CsObject {
+// private String kind;
+// private String apiVersion;
+// private String status;
+// private String message;
+// private String reason;
+// private Details details;
+// private int code;
+//
+// @Data
+// public static class Details {
+// private String name;
+// private String kind;
+// }
+// }
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/BadRequestException.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/BadRequestException.java
new file mode 100644
index 00000000..349b3d70
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/BadRequestException.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.exception.web;
+
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+import static org.springframework.http.HttpStatus.BAD_REQUEST;
+
+/**
+ * 统一异常处理
+ */
+@Getter
+public class BadRequestException extends RuntimeException {
+
+ private Integer status = BAD_REQUEST.value();
+
+ public BadRequestException(String msg) {
+ super(msg);
+ }
+
+ public BadRequestException(HttpStatus status, String msg) {
+ super(msg);
+ this.status = status.value();
+ }
+
+ public BadRequestException(Throwable cause) {
+ // FIXME 20250827 修复完整异常链暴露给用户的问题
+ super(cause.getMessage());
+ this.status = BAD_REQUEST.value();
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/ApiError.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/ApiError.java
new file mode 100644
index 00000000..b02a2120
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/ApiError.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.exception.web.handler;
+
+import lombok.Data;
+
+@Data
+public final class ApiError {
+
+ private Integer status = 400;
+ private Long timestamp;
+ private String message;
+
+ private ApiError() {
+ timestamp = System.currentTimeMillis();
+ }
+
+ public static ApiError error(final String message) {
+ ApiError apiError = new ApiError();
+ apiError.setMessage(message);
+ return apiError;
+ }
+
+ public static ApiError error(final Integer status, final String message) {
+ ApiError apiError = new ApiError();
+ apiError.setStatus(status);
+ apiError.setMessage(message);
+ return apiError;
+ }
+}
+
+
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/GlobalExceptionHandler.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/GlobalExceptionHandler.java
similarity index 74%
rename from cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/GlobalExceptionHandler.java
rename to cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/GlobalExceptionHandler.java
index cc4caadb..f16144f5 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/handler/GlobalExceptionHandler.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/exception/web/handler/GlobalExceptionHandler.java
@@ -1,86 +1,87 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.exception.handler;
-
-import cn.hutool.core.exceptions.ExceptionUtil;
-import cn.odboy.framework.exception.BadRequestException;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.validation.FieldError;
-import org.springframework.validation.ObjectError;
-import org.springframework.web.bind.MethodArgumentNotValidException;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-
-@Slf4j
-@RestControllerAdvice
-public class GlobalExceptionHandler {
-
- /**
- * 处理所有不可知的异常
- */
- @ExceptionHandler(Throwable.class)
- public ResponseEntity handleException(Throwable e) {
- // 打印堆栈信息
- log.error(ExceptionUtil.stacktraceToString(e));
- return buildResponseEntity(ApiError.error(e.getMessage()));
- }
-
- /**
- * BadCredentialsException
- */
- @ExceptionHandler(BadCredentialsException.class)
- public ResponseEntity badCredentialsException(BadCredentialsException e) {
- // 打印堆栈信息
- String message = "坏的凭证".equals(e.getMessage()) ? "用户名或密码不正确" : e.getMessage();
- log.error(message);
- return buildResponseEntity(ApiError.error(message));
- }
-
- /**
- * 处理自定义异常
- */
- @ExceptionHandler(value = BadRequestException.class)
- public ResponseEntity badRequestException(BadRequestException e) {
- // 打印堆栈信息
- log.error(ExceptionUtil.stacktraceToString(e));
- return buildResponseEntity(ApiError.error(e.getStatus(), e.getMessage()));
- }
-
- /**
- * 处理所有接口数据验证异常
- */
- @ExceptionHandler(MethodArgumentNotValidException.class)
- public ResponseEntity handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
- // 打印堆栈信息
- log.error(ExceptionUtil.stacktraceToString(e));
- ObjectError objectError = e.getBindingResult().getAllErrors().get(0);
- String message = objectError.getDefaultMessage();
- if (objectError instanceof FieldError) {
- message = ((FieldError)objectError).getField() + ": " + message;
- }
- return buildResponseEntity(ApiError.error(message));
- }
-
- /**
- * 统一返回
- */
- private ResponseEntity buildResponseEntity(ApiError apiError) {
- return new ResponseEntity<>(apiError, HttpStatus.valueOf(apiError.getStatus()));
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.exception.web.handler;
+
+import cn.hutool.core.exceptions.ExceptionUtil;
+import cn.odboy.framework.exception.web.BadRequestException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.validation.FieldError;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+@Slf4j
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+ /**
+ * 处理所有不可知的异常
+ */
+ @ExceptionHandler(Throwable.class)
+ public ResponseEntity handleException(Throwable e) {
+ // 打印堆栈信息
+ log.error(ExceptionUtil.stacktraceToString(e));
+ return buildResponseEntity(ApiError.error(e.getMessage()));
+ }
+
+ /**
+ * BadCredentialsException
+ */
+ @ExceptionHandler(BadCredentialsException.class)
+ public ResponseEntity badCredentialsException(BadCredentialsException e) {
+ // 打印堆栈信息
+ String message = "坏的凭证".equals(e.getMessage()) ? "用户名或密码不正确" : e.getMessage();
+ log.error(message);
+ return buildResponseEntity(ApiError.error(message));
+ }
+
+ /**
+ * 处理自定义异常
+ */
+ @ExceptionHandler(value = BadRequestException.class)
+ public ResponseEntity badRequestException(BadRequestException e) {
+ // 打印堆栈信息
+ log.error(ExceptionUtil.stacktraceToString(e));
+ return buildResponseEntity(ApiError.error(e.getStatus(), e.getMessage()));
+ }
+
+ /**
+ * 处理所有接口数据验证异常
+ */
+ @ExceptionHandler(MethodArgumentNotValidException.class)
+ public ResponseEntity handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+ // 打印堆栈信息
+ log.error(ExceptionUtil.stacktraceToString(e));
+ ObjectError objectError = e.getBindingResult().getAllErrors().get(0);
+ String message = objectError.getDefaultMessage();
+ if (objectError instanceof FieldError) {
+ message = ((FieldError) objectError).getField() + ": " + message;
+ }
+ return buildResponseEntity(ApiError.error(message));
+ }
+
+ /**
+ * 统一返回
+ */
+ private ResponseEntity buildResponseEntity(ApiError apiError) {
+ return new ResponseEntity<>(apiError, HttpStatus.valueOf(apiError.getStatus()));
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFace.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFace.java
new file mode 100644
index 00000000..debc46b7
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFace.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.logging;
+
+import java.lang.annotation.*;
+
+/**
+ * 统计执行时长
+ *
+ * @author odboy
+ */
+@Inherited
+@Documented
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExecutionTimeStatisticsFace {
+ /**
+ * 接口描述
+ */
+ String description();
+
+ /**
+ * 是否展示异常日志
+ */
+ boolean errorLog() default false;
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFaceAspect.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFaceAspect.java
new file mode 100644
index 00000000..e9d0b0b5
--- /dev/null
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/logging/ExecutionTimeStatisticsFaceAspect.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.logging;
+
+import cn.hutool.core.date.TimeInterval;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.stereotype.Component;
+
+/**
+ * DingtalkApi调用异常
+ *
+ * @author odboy
+ * @date 2025-05-07
+ */
+@Slf4j
+@Aspect
+@Component
+public class ExecutionTimeStatisticsFaceAspect {
+ @Around("@annotation(executionTimeStatisticsFace)")
+ public Object aroundFace(ProceedingJoinPoint joinPoint, ExecutionTimeStatisticsFace executionTimeStatisticsFace) throws Throwable {
+ TimeInterval timeInterval = new TimeInterval();
+ try {
+ Object proceed = joinPoint.proceed();
+ log.info("[{}] 接口执行成功,耗时: {} ms", executionTimeStatisticsFace.description(), timeInterval.intervalMs());
+ return proceed;
+ } catch (Exception e) {
+ if (executionTimeStatisticsFace.errorLog()) {
+ log.info("[{}] 接口执行失败,耗时: {} ms", executionTimeStatisticsFace.description(), timeInterval.intervalMs());
+ }
+ throw e;
+ }
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/controller/HealthCheckController.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/controller/HealthCheckController.java
index 1fa6f257..c282dfb0 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/controller/HealthCheckController.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/controller/HealthCheckController.java
@@ -1,59 +1,60 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.monitor.controller;
-
-import cn.odboy.annotation.AnonymousGetMapping;
-import cn.odboy.framework.monitor.service.CsHealthCheckPointService;
-import io.swagger.annotations.Api;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 健康检查接口
- */
-@RestController
-@RequestMapping("/healthCheck")
-@Api(tags = "系统:健康检查接口")
-public class HealthCheckController {
- @Autowired
- private CsHealthCheckPointService healthCheckPointService;
-
- /**
- * 就绪检查
- */
- @AnonymousGetMapping(value = "/readiness")
- public ResponseEntity> doReadiness() {
- return healthCheckPointService.doReadiness();
- }
-
- /**
- * 存活检查
- */
- @AnonymousGetMapping(value = "/liveness")
- public ResponseEntity> doLiveness() {
- return healthCheckPointService.doLiveness();
- }
-
- // /**
- // * 访问首页提示
- // */
- // @AnonymousGetMapping("/")
- // public String index() {
- // return "success";
- // }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.monitor.controller;
+
+import cn.odboy.annotation.AnonymousGetMapping;
+import cn.odboy.framework.monitor.service.CsHealthCheckPointService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 健康检查接口
+ */
+@RestController
+@RequestMapping("/healthCheck")
+@Api(tags = "系统:健康检查接口")
+public class HealthCheckController {
+ @Autowired
+ private CsHealthCheckPointService healthCheckPointService;
+
+ /**
+ * 就绪检查
+ */
+ @AnonymousGetMapping(value = "/readiness")
+ public ResponseEntity> doReadiness() {
+ return healthCheckPointService.doReadiness();
+ }
+
+ /**
+ * 存活检查
+ */
+ @AnonymousGetMapping(value = "/liveness")
+ public ResponseEntity> doLiveness() {
+ return healthCheckPointService.doLiveness();
+ }
+
+ // /**
+ // * 访问首页提示
+ // */
+ // @AnonymousGetMapping("/")
+ // public String index() {
+ // return "success";
+ // }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/service/CsHealthCheckPointService.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/service/CsHealthCheckPointService.java
index a825cbd3..0061e8ac 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/service/CsHealthCheckPointService.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/monitor/service/CsHealthCheckPointService.java
@@ -1,30 +1,31 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.monitor.service;
-
-import org.springframework.http.ResponseEntity;
-
-public interface CsHealthCheckPointService {
- /**
- * 就绪检查
- */
- ResponseEntity> doReadiness();
-
- /**
- * 存活检查
- */
- ResponseEntity> doLiveness();
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.monitor.service;
+
+import org.springframework.http.ResponseEntity;
+
+public interface CsHealthCheckPointService {
+ /**
+ * 就绪检查
+ */
+ ResponseEntity> doReadiness();
+
+ /**
+ * 存活检查
+ */
+ ResponseEntity> doLiveness();
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQTypeEnum.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQTypeEnum.java
index a91b5cd0..6ea9c27e 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQTypeEnum.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQTypeEnum.java
@@ -1,74 +1,87 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-/**
- * 动态查询 枚举
- */
-public enum CsMpQTypeEnum {
- /**
- * 相等
- */
- EQUAL
- /**
- * 大于等于
- */
- , GREATER_THAN
- /**
- * 小于等于
- */
- , LESS_THAN
- /**
- * 中模糊查询
- */
- , INNER_LIKE
- /**
- * 左模糊查询
- */
- , LEFT_LIKE
- /**
- * 右模糊查询
- */
- , RIGHT_LIKE
- /**
- * 小于
- */
- , LESS_THAN_NQ
- /**
- * 包含
- */
- , IN
- /**
- * 不包含
- */
- , NOT_IN
- /**
- * 不等于
- */
- , NOT_EQUAL
- /**
- * between(注:被注解的属性一定得是数组或者集合, 长度大于等于2)
- */
- , BETWEEN
- /**
- * 不为空
- */
- , NOT_NULL
- /**
- * 为空
- */
- , IS_NULL
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+/**
+ * 动态查询 枚举
+ */
+public enum CsMpQTypeEnum {
+ /**
+ * 相等
+ */
+ EQUAL
+ /**
+ * 大于等于
+ */
+ ,
+ GREATER_THAN
+ /**
+ * 小于等于
+ */
+ ,
+ LESS_THAN
+ /**
+ * 中模糊查询
+ */
+ ,
+ INNER_LIKE
+ /**
+ * 左模糊查询
+ */
+ ,
+ LEFT_LIKE
+ /**
+ * 右模糊查询
+ */
+ ,
+ RIGHT_LIKE
+ /**
+ * 小于
+ */
+ ,
+ LESS_THAN_NQ
+ /**
+ * 包含
+ */
+ ,
+ IN
+ /**
+ * 不包含
+ */
+ ,
+ NOT_IN
+ /**
+ * 不等于
+ */
+ ,
+ NOT_EQUAL
+ /**
+ * between(注:被注解的属性一定得是数组或者集合, 长度大于等于2)
+ */
+ ,
+ BETWEEN
+ /**
+ * 不为空
+ */
+ ,
+ NOT_NULL
+ /**
+ * 为空
+ */
+ ,
+ IS_NULL
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQuery.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQuery.java
index 492cefdd..68f87c9c 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQuery.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/CsMpQuery.java
@@ -1,73 +1,74 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 查询描述
- *
- * @date 2023-11-25
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CsMpQuery {
- /**
- * 基本对象的属性名
- */
- String propName() default "";
-
- /**
- * 查询方式
- */
- CsMpQTypeEnum type() default CsMpQTypeEnum.EQUAL;
-
- /**
- * 连接查询的属性名, 如User类中的dept
- */
- String joinName() default "";
-
- /**
- * 默认左连接
- */
- Join join() default Join.LEFT;
-
- /**
- * 多字段模糊搜索, 仅支持String类型字段, 多个用逗号隔开, 如@MpQuery(blurry = "email,username")
- */
- String blurry() default "";
-
- /**
- * 适用于简单连接查询, 复杂的请自定义该注解, 或者使用sql查询
- */
- enum Join {
- /**
- * 左连接
- */
- LEFT,
- /**
- * 右连接
- */
- RIGHT,
- /**
- * 内连接
- */
- INNER
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 查询描述
+ *
+ * @date 2023-11-25
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CsMpQuery {
+ /**
+ * 基本对象的属性名
+ */
+ String propName() default "";
+
+ /**
+ * 查询方式
+ */
+ CsMpQTypeEnum type() default CsMpQTypeEnum.EQUAL;
+
+ /**
+ * 连接查询的属性名, 如User类中的dept
+ */
+ String joinName() default "";
+
+ /**
+ * 默认左连接
+ */
+ Join join() default Join.LEFT;
+
+ /**
+ * 多字段模糊搜索, 仅支持String类型字段, 多个用逗号隔开, 如@MpQuery(blurry = "email,username")
+ */
+ String blurry() default "";
+
+ /**
+ * 适用于简单连接查询, 复杂的请自定义该注解, 或者使用sql查询
+ */
+ enum Join {
+ /**
+ * 左连接
+ */
+ LEFT,
+ /**
+ * 右连接
+ */
+ RIGHT,
+ /**
+ * 内连接
+ */
+ INNER
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/DataTypeEnum.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/DataTypeEnum.java
index d21d0fd3..d8bd9dc6 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/DataTypeEnum.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/DataTypeEnum.java
@@ -1,151 +1,159 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import cn.odboy.framework.exception.BadRequestException;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * @author /
- */
-@Slf4j
-@SuppressWarnings({"unchecked", "all"})
-public enum DataTypeEnum {
- /**
- * mysql
- */
- MYSQL("mysql", "mysql", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
- /**
- * oracle
- */
- ORACLE("oracle", "oracle", "oracle.jdbc.driver.OracleDriver", "\"", "\"", "\"", "\""),
- /**
- * sql config
- */
- SQLSERVER("sqlserver", "sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "\"", "\"", "\"", "\""),
- /**
- * h2
- */
- H2("h2", "h2", "org.h2.Driver", "`", "`", "\"", "\""),
- /**
- * phoenix
- */
- PHOENIX("phoenix", "hbase phoenix", "org.apache.phoenix.jdbc.PhoenixDriver", "", "", "\"", "\""),
- /**
- * mongo
- */
- MONGODB("mongo", "mongodb", "mongodb.jdbc.MongoDriver", "`", "`", "\"", "\""),
- /**
- * sql4es
- */
- ELASTICSEARCH("sql4es", "elasticsearch", "nl.anchormen.sql4es.jdbc.ESDriver", "", "", "'", "'"),
- /**
- * presto
- */
- PRESTO("presto", "presto", "com.facebook.presto.jdbc.PrestoDriver", "", "", "\"", "\""),
- /**
- * moonbox
- */
- MOONBOX("moonbox", "moonbox", "moonbox.jdbc.MbDriver", "`", "`", "`", "`"),
- /**
- * cassandra
- */
- CASSANDRA("cassandra", "cassandra", "com.github.adejanovski.cassandra.jdbc.CassandraDriver", "", "", "'", "'"),
- /**
- * click house
- */
- CLICKHOUSE("clickhouse", "clickhouse", "ru.yandex.clickhouse.ClickHouseDriver", "", "", "\"", "\""),
- /**
- * kylin
- */
- KYLIN("kylin", "kylin", "org.apache.kylin.jdbc.Driver", "\"", "\"", "\"", "\""),
- /**
- * vertica
- */
- VERTICA("vertica", "vertica", "com.vertica.jdbc.Driver", "", "", "'", "'"),
- /**
- * sap
- */
- HANA("sap", "sap hana", "com.sap.db.jdbc.Driver", "", "", "'", "'"),
- /**
- * impala
- */
- IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'");
- private String feature;
- private String desc;
- private String driver;
- private String keywordPrefix;
- private String keywordSuffix;
- private String aliasPrefix;
- private String aliasSuffix;
- private static final String JDBC_URL_PREFIX = "jdbc:";
-
- DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix, String aliasPrefix, String aliasSuffix) {
- this.feature = feature;
- this.desc = desc;
- this.driver = driver;
- this.keywordPrefix = keywordPrefix;
- this.keywordSuffix = keywordSuffix;
- this.aliasPrefix = aliasPrefix;
- this.aliasSuffix = aliasSuffix;
- }
-
- public static DataTypeEnum urlOf(String jdbcUrl) {
- String url = jdbcUrl.toLowerCase().trim();
- for (DataTypeEnum dataTypeEnum : values()) {
- if (url.startsWith(JDBC_URL_PREFIX + dataTypeEnum.feature)) {
- try {
- Class> aClass = Class.forName(dataTypeEnum.getDriver());
- if (null == aClass) {
- throw new BadRequestException("Unable to get driver instance for jdbcUrl: " + jdbcUrl);
- }
- } catch (ClassNotFoundException e) {
- throw new BadRequestException("Unable to get driver instance: " + jdbcUrl);
- }
- return dataTypeEnum;
- }
- }
- return null;
- }
-
- public String getFeature() {
- return feature;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public String getDriver() {
- return driver;
- }
-
- public String getKeywordPrefix() {
- return keywordPrefix;
- }
-
- public String getKeywordSuffix() {
- return keywordSuffix;
- }
-
- public String getAliasPrefix() {
- return aliasPrefix;
- }
-
- public String getAliasSuffix() {
- return aliasSuffix;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import cn.odboy.framework.exception.web.BadRequestException;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author /
+ */
+@Slf4j
+@SuppressWarnings({"unchecked", "all"})
+public enum DataTypeEnum {
+ /**
+ * mysql
+ */
+ MYSQL("mysql", "mysql", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
+ /**
+ * oracle
+ */
+ ORACLE("oracle", "oracle", "oracle.jdbc.driver.OracleDriver", "\"", "\"", "\"", "\""),
+ /**
+ * sql config
+ */
+ SQLSERVER("sqlserver", "sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "\"", "\"", "\"", "\""),
+ /**
+ * h2
+ */
+ H2("h2", "h2", "org.h2.Driver", "`", "`", "\"", "\""),
+ /**
+ * phoenix
+ */
+ PHOENIX("phoenix", "hbase phoenix", "org.apache.phoenix.jdbc.PhoenixDriver", "", "", "\"", "\""),
+ /**
+ * mongo
+ */
+ MONGODB("mongo", "mongodb", "mongodb.jdbc.MongoDriver", "`", "`", "\"", "\""),
+ /**
+ * sql4es
+ */
+ ELASTICSEARCH("sql4es", "elasticsearch", "nl.anchormen.sql4es.jdbc.ESDriver", "", "", "'", "'"),
+ /**
+ * presto
+ */
+ PRESTO("presto", "presto", "com.facebook.presto.jdbc.PrestoDriver", "", "", "\"", "\""),
+ /**
+ * moonbox
+ */
+ MOONBOX("moonbox", "moonbox", "moonbox.jdbc.MbDriver", "`", "`", "`", "`"),
+ /**
+ * cassandra
+ */
+ CASSANDRA("cassandra", "cassandra", "com.github.adejanovski.cassandra.jdbc.CassandraDriver", "", "", "'", "'"),
+ /**
+ * click house
+ */
+ CLICKHOUSE("clickhouse", "clickhouse", "ru.yandex.clickhouse.ClickHouseDriver", "", "", "\"", "\""),
+ /**
+ * kylin
+ */
+ KYLIN("kylin", "kylin", "org.apache.kylin.jdbc.Driver", "\"", "\"", "\"", "\""),
+ /**
+ * vertica
+ */
+ VERTICA("vertica", "vertica", "com.vertica.jdbc.Driver", "", "", "'", "'"),
+ /**
+ * sap
+ */
+ HANA("sap", "sap hana", "com.sap.db.jdbc.Driver", "", "", "'", "'"),
+ /**
+ * impala
+ */
+ IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'");
+ private String feature;
+ private String desc;
+ private String driver;
+ private String keywordPrefix;
+ private String keywordSuffix;
+ private String aliasPrefix;
+ private String aliasSuffix;
+ private static final String JDBC_URL_PREFIX = "jdbc:";
+
+ DataTypeEnum(
+ String feature,
+ String desc,
+ String driver,
+ String keywordPrefix,
+ String keywordSuffix,
+ String aliasPrefix,
+ String aliasSuffix) {
+ this.feature = feature;
+ this.desc = desc;
+ this.driver = driver;
+ this.keywordPrefix = keywordPrefix;
+ this.keywordSuffix = keywordSuffix;
+ this.aliasPrefix = aliasPrefix;
+ this.aliasSuffix = aliasSuffix;
+ }
+
+ public static DataTypeEnum urlOf(String jdbcUrl) {
+ String url = jdbcUrl.toLowerCase().trim();
+ for (DataTypeEnum dataTypeEnum : values()) {
+ if (url.startsWith(JDBC_URL_PREFIX + dataTypeEnum.feature)) {
+ try {
+ Class> aClass = Class.forName(dataTypeEnum.getDriver());
+ if (null == aClass) {
+ throw new BadRequestException("Unable to get driver instance for jdbcUrl: " + jdbcUrl);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new BadRequestException("Unable to get driver instance: " + jdbcUrl);
+ }
+ return dataTypeEnum;
+ }
+ }
+ return null;
+ }
+
+ public String getFeature() {
+ return feature;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getDriver() {
+ return driver;
+ }
+
+ public String getKeywordPrefix() {
+ return keywordPrefix;
+ }
+
+ public String getKeywordSuffix() {
+ return keywordSuffix;
+ }
+
+ public String getAliasPrefix() {
+ return aliasPrefix;
+ }
+
+ public String getAliasSuffix() {
+ return aliasSuffix;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpCustomP6SpyLogger.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpCustomP6SpyLogger.java
index 87914710..077a7d5f 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpCustomP6SpyLogger.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpCustomP6SpyLogger.java
@@ -1,66 +1,66 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import cn.hutool.core.util.StrUtil;
-import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * 自定义 p6spy sql输出格式
- */
-@Slf4j
-public class MpCustomP6SpyLogger implements MessageFormattingStrategy {
- /**
- * 重置颜色
- */
- private static final String RESET = "\u001B[0m";
- /**
- * 红色
- */
- private static final String RED = "\u001B[31m";
- /**
- * 绿色
- */
- private static final String GREEN = "\u001B[32m";
- /**
- * 蓝色
- */
- private static final String BLUE = "\u001B[34m";
-
- /**
- * 格式化 sql
- *
- * @param connectionId 连接id
- * @param now 当前时间
- * @param elapsed 执行时长
- * @param category sql分类
- * @param prepared 预编译sql
- * @param sql 执行sql
- * @param url 数据库连接url
- * @return 格式化后的sql
- */
- @Override
- public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
- // 去掉换行和多余空格
- if (StrUtil.isNotBlank(sql)) {
- sql = sql.replaceAll("\\s+", " ").trim();
- }
- // 格式化并加上颜色
- return String.format("CuteJava - %s%s%s %s[%s] %sREVIEW_SQL [Interval: %dms]%s -> %s;", RED, now, RESET, GREEN, Thread.currentThread().getName(), BLUE,
- elapsed, RESET, sql);
- }
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import cn.hutool.core.util.StrUtil;
+import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 自定义 p6spy sql输出格式
+ */
+@Slf4j
+public class MpCustomP6SpyLogger implements MessageFormattingStrategy {
+ /**
+ * 重置颜色
+ */
+ private static final String RESET = "\u001B[0m";
+ /**
+ * 红色
+ */
+ private static final String RED = "\u001B[31m";
+ /**
+ * 绿色
+ */
+ private static final String GREEN = "\u001B[32m";
+ /**
+ * 蓝色
+ */
+ private static final String BLUE = "\u001B[34m";
+
+ /**
+ * 格式化 sql
+ *
+ * @param connectionId 连接id
+ * @param now 当前时间
+ * @param elapsed 执行时长
+ * @param category sql分类
+ * @param prepared 预编译sql
+ * @param sql 执行sql
+ * @param url 数据库连接url
+ * @return 格式化后的sql
+ */
+ @Override
+ public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
+ // 去掉换行和多余空格
+ if (StrUtil.isNotBlank(sql)) {
+ sql = sql.replaceAll("\\s+", " ").trim();
+ }
+ // 格式化并加上颜色
+ return String.format("CuteJava - %s%s%s %s[%s] %sREVIEW_SQL [Interval: %dms]%s -> %s;", RED, now, RESET, GREEN, Thread.currentThread().getName(), BLUE, elapsed, RESET, sql);
+ }
}
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpInsertBatchSqlInjector.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpInsertBatchSqlInjector.java
index f90654ab..6cf2cacf 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpInsertBatchSqlInjector.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MpInsertBatchSqlInjector.java
@@ -1,44 +1,45 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.core.injector.AbstractMethod;
-import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
-import com.baomidou.mybatisplus.core.metadata.TableInfo;
-import com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById;
-import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
-import org.apache.ibatis.session.Configuration;
-
-import java.util.List;
-
-/**
- * 批量插入SQL注入器
- *
- * @author odboy
- * @date 2025-01-11
- */
-public class MpInsertBatchSqlInjector extends DefaultSqlInjector {
- @Override
- public List getMethodList(Configuration configuration, Class> mapperClass, TableInfo tableInfo) {
- List methodList = super.getMethodList(configuration, mapperClass, tableInfo);
- // 新增自定义方法, InsertBatchSomeColumn这个方法Mp没有开放出来
- methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE));
- // 全量更新, 包括null字段
- methodList.add(new AlwaysUpdateSomeColumnById(i -> i.getFieldFill() != FieldFill.INSERT));
- return methodList;
- }
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.core.injector.AbstractMethod;
+import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
+import com.baomidou.mybatisplus.core.metadata.TableInfo;
+import com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById;
+import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
+import org.apache.ibatis.session.Configuration;
+
+import java.util.List;
+
+/**
+ * 批量插入SQL注入器
+ *
+ * @author odboy
+ * @date 2025-01-11
+ */
+public class MpInsertBatchSqlInjector extends DefaultSqlInjector {
+ @Override
+ public List getMethodList(Configuration configuration, Class> mapperClass, TableInfo tableInfo) {
+ List methodList = super.getMethodList(configuration, mapperClass, tableInfo);
+ // 新增自定义方法, InsertBatchSomeColumn这个方法Mp没有开放出来
+ methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE));
+ // 全量更新, 包括null字段
+ methodList.add(new AlwaysUpdateSomeColumnById(i -> i.getFieldFill() != FieldFill.INSERT));
+ return methodList;
+ }
}
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MybatisPlusConfig.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MybatisPlusConfig.java
index 03072312..be54eea8 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MybatisPlusConfig.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/MybatisPlusConfig.java
@@ -1,54 +1,55 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import com.baomidou.mybatisplus.annotation.DbType;
-import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-@Configuration
-@EnableTransactionManagement
-public class MybatisPlusConfig {
- @Bean
- public MybatisPlusInterceptor paginationInterceptor() {
- MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
- // MySQL的分页拦截器
- PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
- paginationInnerInterceptor.setMaxLimit(500L);
- /// 这个配置会导致:当分页没数据时, 游标从0开始,会导致无论page为什么值,就算分页超出最大页数,依然能够查询到
- /// paginationInnerInterceptor.setOverflow(true);
- paginationInnerInterceptor.setOptimizeJoin(true);
- interceptor.addInnerInterceptor(paginationInnerInterceptor);
- // 乐观锁
- interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
- // 防全表更新与删除
- interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
- return interceptor;
- }
-
- /**
- * Mapper支持批量插入
- */
- @Bean
- public MpInsertBatchSqlInjector insertBatchSqlInjector() {
- return new MpInsertBatchSqlInjector();
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@EnableTransactionManagement
+public class MybatisPlusConfig {
+ @Bean
+ public MybatisPlusInterceptor paginationInterceptor() {
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+ // MySQL的分页拦截器
+ PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
+ paginationInnerInterceptor.setMaxLimit(500L);
+ /// 这个配置会导致:当分页没数据时, 游标从0开始,会导致无论page为什么值,就算分页超出最大页数,依然能够查询到
+ /// paginationInnerInterceptor.setOverflow(true);
+ paginationInnerInterceptor.setOptimizeJoin(true);
+ interceptor.addInnerInterceptor(paginationInnerInterceptor);
+ // 乐观锁
+ interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
+ // 防全表更新与删除
+ interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
+ return interceptor;
+ }
+
+ /**
+ * Mapper支持批量插入
+ */
+ @Bean
+ public MpInsertBatchSqlInjector insertBatchSqlInjector() {
+ return new MpInsertBatchSqlInjector();
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/RemoveDruidAdConfig.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/RemoveDruidAdConfig.java
index 069e2e18..fee77445 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/RemoveDruidAdConfig.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/config/RemoveDruidAdConfig.java
@@ -1,90 +1,92 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.config;
-
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
-import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
-import com.alibaba.druid.util.Utils;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-@Configuration
-@SuppressWarnings({"unchecked", "all"})
-@ConditionalOnWebApplication
-@AutoConfigureAfter(DruidDataSourceAutoConfigure.class)
-@ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true", matchIfMissing = true)
-public class RemoveDruidAdConfig {
-
- /**
- * 方法名: removeDruidAdFilterRegistrationBean 方法描述 除去页面底部的广告
- *
- * @param properties com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties
- * @return org.springframework.boot.web.servlet.FilterRegistrationBean
- */
- @Bean
- public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
-
- // 获取web监控页面的参数
- DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
- // 提取common.js的配置路径
- String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
- String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
-
- final String filePath = "support/http/resources/js/common.js";
-
- //创建filter进行过滤
- Filter filter = new Filter() {
- @Override
- public void init(FilterConfig filterConfig) throws ServletException {
- }
-
- @Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- HttpServletRequest httpRequest = (HttpServletRequest)request;
- HttpServletResponse httpResponse = (HttpServletResponse)response;
- if (httpRequest.getRequestURI().endsWith("js/common.js")) {
- // 获取common.js
- String text = Utils.readFromResource(filePath);
- // 正则替换banner, 除去底部的广告信息
- text = text.replaceAll(" ", "");
- text = text.replaceAll("powered by.*?shrek.wang", "");
- httpResponse.setContentType("application/javascript");
- httpResponse.setCharacterEncoding("UTF-8");
- httpResponse.getWriter().write(text);
- } else {
- chain.doFilter(request, response);
- }
- }
-
- @Override
- public void destroy() {
- }
- };
- FilterRegistrationBean registrationBean = new FilterRegistrationBean();
- registrationBean.setFilter(filter);
- registrationBean.addUrlPatterns(commonJsPattern);
- return registrationBean;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.config;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
+import com.alibaba.druid.util.Utils;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@Configuration
+@SuppressWarnings({"unchecked", "all"})
+@ConditionalOnWebApplication
+@AutoConfigureAfter(DruidDataSourceAutoConfigure.class)
+@ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true", matchIfMissing = true)
+public class RemoveDruidAdConfig {
+
+ /**
+ * 方法名: removeDruidAdFilterRegistrationBean 方法描述 除去页面底部的广告
+ *
+ * @param properties com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties
+ * @return org.springframework.boot.web.servlet.FilterRegistrationBean
+ */
+ @Bean
+ public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
+
+ // 获取web监控页面的参数
+ DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
+ // 提取common.js的配置路径
+ String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
+ String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
+
+ final String filePath = "support/http/resources/js/common.js";
+
+ //创建filter进行过滤
+ Filter filter = new Filter() {
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+ HttpServletRequest httpRequest = (HttpServletRequest) request;
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
+ if (httpRequest.getRequestURI().endsWith("js/common.js")) {
+ // 获取common.js
+ String text = Utils.readFromResource(filePath);
+ // 正则替换banner, 除去底部的广告信息
+ text = text.replaceAll(" ", "");
+ text = text.replaceAll("powered by.*?shrek.wang", "");
+ httpResponse.setContentType("application/javascript");
+ httpResponse.setCharacterEncoding("UTF-8");
+ httpResponse.getWriter().write(text);
+ } else {
+ chain.doFilter(request, response);
+ }
+ }
+
+ @Override
+ public void destroy() {
+ }
+ };
+ FilterRegistrationBean registrationBean = new FilterRegistrationBean();
+ registrationBean.setFilter(filter);
+ registrationBean.addUrlPatterns(commonJsPattern);
+ return registrationBean;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpAnyQUtil.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpAnyQUtil.java
index 57037355..af7d0d65 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpAnyQUtil.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpAnyQUtil.java
@@ -1,81 +1,86 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.core;
-
-import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 自定义任意对象查询工具
- *
- * @author odboy
- * @date 2025-05-15
- */
-public class CsMpAnyQUtil {
- public static T selectOne(BaseMapper baseMapper, Object queryParams) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- return baseMapper.selectOne(queryWrapper);
- }
-
- public static M selectOne(BaseMapper baseMapper, Object queryParams, Class mapperClazz) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- T mapperTarget = baseMapper.selectOne(queryWrapper);
- if (mapperTarget == null) {
- return null;
- }
- return BeanUtil.copyProperties(mapperTarget, mapperClazz);
- }
-
- public static List selectList(BaseMapper baseMapper, Object queryParams) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- return baseMapper.selectList(queryWrapper);
- }
-
- public static List selectList(BaseMapper baseMapper, Object queryParams, Class mapperClazz) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- List mapperTarget = baseMapper.selectList(queryWrapper);
- if (mapperTarget == null) {
- return new ArrayList<>();
- }
- return BeanUtil.copyToList(mapperTarget, mapperClazz);
- }
-
- public static Long selectCount(BaseMapper baseMapper, Object queryParams) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- return baseMapper.selectCount(queryWrapper);
- }
-
- public static Page selectPage(BaseMapper baseMapper, Page page, Object queryParams) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- return baseMapper.selectPage(page, queryWrapper);
- }
-
- public static Page selectPage(BaseMapper baseMapper, Page page, Object queryParams, Class mapperClazz) {
- QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
- Page tPage = baseMapper.selectPage(page, queryWrapper);
- Page mapperTarget = new Page<>();
- mapperTarget.setRecords(BeanUtil.copyToList(tPage.getRecords(), mapperClazz));
- mapperTarget.setTotal(tPage.getTotal());
- mapperTarget.setSize(tPage.getSize());
- mapperTarget.setCurrent(tPage.getCurrent());
- return mapperTarget;
- }
-}
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.core;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 自定义任意对象查询工具
+ *
+ * @author odboy
+ * @date 2025-05-15
+ */
+public class CsMpAnyQUtil {
+ public static T selectOne(BaseMapper baseMapper, Object queryParams) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ return baseMapper.selectOne(queryWrapper);
+ }
+
+ public static M selectOne(BaseMapper baseMapper, Object queryParams, Class mapperClazz) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ T mapperTarget = baseMapper.selectOne(queryWrapper);
+ if (mapperTarget == null) {
+ return null;
+ }
+ return BeanUtil.copyProperties(mapperTarget, mapperClazz);
+ }
+
+ public static List selectList(BaseMapper baseMapper, Object queryParams) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ return baseMapper.selectList(queryWrapper);
+ }
+
+ public static List selectList(BaseMapper baseMapper, Object queryParams, Class mapperClazz) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ List mapperTarget = baseMapper.selectList(queryWrapper);
+ if (mapperTarget == null) {
+ return new ArrayList<>();
+ }
+ return BeanUtil.copyToList(mapperTarget, mapperClazz);
+ }
+
+ public static Long selectCount(BaseMapper baseMapper, Object queryParams) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ return baseMapper.selectCount(queryWrapper);
+ }
+
+ public static Page selectPage(BaseMapper baseMapper, Page page, Object queryParams) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ return baseMapper.selectPage(page, queryWrapper);
+ }
+
+ public static Page selectPage(
+ BaseMapper baseMapper,
+ Page page,
+ Object queryParams,
+ Class mapperClazz) {
+ QueryWrapper queryWrapper = CsMpQUtil.build(queryParams);
+ Page tPage = baseMapper.selectPage(page, queryWrapper);
+ Page mapperTarget = new Page<>();
+ mapperTarget.setRecords(BeanUtil.copyToList(tPage.getRecords(), mapperClazz));
+ mapperTarget.setTotal(tPage.getTotal());
+ mapperTarget.setSize(tPage.getSize());
+ mapperTarget.setCurrent(tPage.getCurrent());
+ return mapperTarget;
+ }
+}
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpCmdGenUtil.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpCmdGenUtil.java
index cbc954be..bc34f1b1 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpCmdGenUtil.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpCmdGenUtil.java
@@ -1,200 +1,228 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.core;
-
-import cn.hutool.core.util.StrUtil;
-import cn.odboy.base.CsBaseUserTimeTb;
-import cn.odboy.framework.exception.BadRequestException;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.generator.FastAutoGenerator;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery;
-import com.baomidou.mybatisplus.generator.config.rules.DateType;
-import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine;
-import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
-import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
-import lombok.Data;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.sql.Types;
-import java.util.Collections;
-import java.util.List;
-import java.util.function.Consumer;
-
-/**
- * 代码生成器入口
- *
- * @author odboy
- * @date 2025-01-11
- */
-@Data
-public class CsMpCmdGenUtil {
- // 项目根路径。生成结果 C:\Users\Administrator\Documents\GitHub\cutejava\cutejava
- private static final String projectRootPath = System.getProperty("user.dir") + "/";
- /**
- * 数据库类型 MySQL
- */
- private static final IDbQuery DB_QUERY = new MySqlQuery();
- /**
- * 类型转换
- */
- private static final String TYPE_TINY_INT = "tinyint";
- private static final String TYPE_DATETIME = "datetime";
- private static final String TYPE_DATE = "date";
- private String databaseUrl;
- private String databaseUsername;
- private String databasePassword;
- private String driverClassName;
- private String parentPackageName = "cn.odboy";
- private String parentModuleName;
-
- /**
- * 代码生成函数
- *
- * @param moduleName 模块名称
- * @param tablePrefix 表前缀(可空)
- * @param tableNames 表名称, 多个用逗号分隔
- */
- public void gen(String moduleName, String tablePrefix, List tableNames) {
- this.parentModuleName = moduleName;
- // 1.数据库配置
- DataSourceConfig.Builder dataSourceConfigBuilder =
- new DataSourceConfig.Builder(this.databaseUrl, this.databaseUsername, this.databasePassword).driverClassName(this.driverClassName);
- dataSourceConfigBuilder.dbQuery(DB_QUERY);
- dataSourceConfigBuilder.keyWordsHandler(new MySqlKeyWordsHandler());
- // 1.1.快速生成器
- FastAutoGenerator fastAutoGenerator = FastAutoGenerator.create(dataSourceConfigBuilder);
- // 2.全局配置
- // 自定义类型转换
- fastAutoGenerator.dataSourceConfig(getDataSourceConfigConsumer());
- // 覆盖已生成文件
- // 添加swagger注解
- // 设置注释的作者
- // 设置注释的日期格式
- // 使用java8新的时间类型
- fastAutoGenerator.globalConfig(getGlobalConfigConsumer());
- // 3.包配置
- // 设置父包名
- // 设置父包模块名
- // 设置MVC下各个模块的包名
- // 设置XML资源文件的目录
- fastAutoGenerator.packageConfig(getPackageConfigConsumer());
- // 4.模板配置
- // 使用Freemarker引擎模板, 默认的是Velocity引擎模板
- AbstractTemplateEngine templateEngine = new FreemarkerTemplateEngine();
- fastAutoGenerator.templateEngine(templateEngine);
- // 5.策略配置
- // 设置需要生成的表名
- // 设置过滤表前缀
- fastAutoGenerator.strategyConfig(getStrategyConfigConsumer(tableNames));
- if (tablePrefix != null) {
- // 表前缀, 可多个
- fastAutoGenerator.strategyConfig(strategyConfigBuilder -> strategyConfigBuilder.addTablePrefix(tablePrefix));
- }
- // 5.1.Entity策略配置
- // 生成实体时生成字段的注解, 包括@TableId注解等
- // 数据库表和字段映射到实体的命名策略, 为下划线转驼峰
- // 全局主键类型为None
- // 实体名称格式化为XXXEntity
- fastAutoGenerator.strategyConfig(getEntityConfigConsumer());
- // 5.2.Controller策略配置
- // 开启生成@RestController控制器
- fastAutoGenerator.strategyConfig(strategyConfigBuilder -> strategyConfigBuilder.controllerBuilder().enableRestStyle());
- // 如果不需要生成Controller, fastAutoGenerator.templateConfig(templateConfig -> templateConfig.controller(""))。5.3.Service策略配置:格式化service接口和实现类的文件名称, 去掉默认的ServiceName前面的I
- fastAutoGenerator.strategyConfig(
- strategyConfigBuilder -> strategyConfigBuilder.serviceBuilder().formatServiceFileName("%sService").formatServiceImplFileName("%sServiceImpl"));
- // 5.4.Mapper策略配置
- // 格式化 mapper文件名,格式化xml实现类文件名称
- fastAutoGenerator.strategyConfig(getStrategyConfigConsumer());
- // 6.生成代码
- fastAutoGenerator.execute();
- }
-
- private static Consumer getEntityConfigConsumer() {
- return strategyConfigBuilder -> strategyConfigBuilder.entityBuilder().enableLombok()
- // 如果不需要生成注解, 去掉.enableTableFieldAnnotation()
- .enableTableFieldAnnotation().enableFileOverride().naming(NamingStrategy.underline_to_camel).columnNaming(NamingStrategy.underline_to_camel)
- .idType(IdType.AUTO);
- }
-
- private static Consumer getStrategyConfigConsumer(List tableNames) {
- return strategyConfigBuilder -> strategyConfigBuilder.enableCapitalMode().enableSkipView().disableSqlFilter().addInclude(tableNames)
- // 实体类生成策略
- .entityBuilder().superClass(CsBaseUserTimeTb.class).addIgnoreColumns("create_time", "update_time", "create_by", "update_by")
- // 开启生成实体时生成字段注解。
- // 会在实体类的属性前,添加[@TableField("nickname")]
- .enableTableFieldAnnotation().disableSerialVersionUID()
- // 阶段2:Mapper策略配置
- .mapperBuilder()
- // 开启 @Mapper 注解。
- // 会在mapper接口上添加注解[@Mapper]
- // .enableMapperAnnotation()
- // 启用 BaseResultMap 生成。
- // 会在mapper.xml文件生成[通用查询映射结果]配置。
- // .enableBaseResultMap()
- // 启用 BaseColumnList。
- // 会在mapper.xml文件生成[通用查询结果列 ]配置
- // .enableBaseColumnList()
- // 阶段4:Controller策略配置
- .controllerBuilder()
- // 会在控制类中加[@RestController]注解。
- .enableRestStyle()
- // 开启驼峰转连字符
- .enableHyphenStyle().build();
- }
-
- private Consumer getPackageConfigConsumer() {
- String mapperPath = projectRootPath + "CodeGen/resources/mapper";
- if (StrUtil.isBlank(this.parentModuleName)) {
- throw new BadRequestException("模块名称必填");
- }
- return packageConfigBuilder -> packageConfigBuilder.parent(this.parentPackageName).moduleName(this.parentModuleName).entity("dal.dataobject")
- .mapper("dal.mysql").service("service").serviceImpl("service.impl").controller("controller")
- .pathInfo(Collections.singletonMap(OutputFile.xml, mapperPath));
- }
-
- private static Consumer getGlobalConfigConsumer() {
- String outputDir = projectRootPath + "CodeGen";
- return globalConfigBuilder -> globalConfigBuilder.enableSwagger().outputDir(outputDir).author("codegen").commentDate("yyyy-MM-dd")
- .dateType(DateType.TIME_PACK);
- }
-
- private static Consumer getStrategyConfigConsumer() {
- return strategyConfigBuilder -> strategyConfigBuilder.mapperBuilder().mapperAnnotation(Mapper.class).formatMapperFileName("%sMapper")
- .formatXmlFileName("%sMapper").entityBuilder().formatFileName("%sTb");
- }
-
- private static Consumer getDataSourceConfigConsumer() {
- return builder -> builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
- int typeCode = metaInfo.getJdbcType().TYPE_CODE;
- if (typeCode == Types.SMALLINT) {
- return DbColumnType.INTEGER;
- }
- if (typeCode == Types.DATE) {
- return DbColumnType.DATE;
- }
- if (typeCode == Types.TIME) {
- return DbColumnType.DATE;
- }
- if (typeCode == Types.TIMESTAMP) {
- return DbColumnType.DATE;
- }
- return typeRegistry.getColumnType(metaInfo);
- });
- }
+/*
+ * Copyright 2021-2025 Odboy
+ *
+ * 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 cn.odboy.framework.mybatisplus.core;
+
+import cn.hutool.core.util.StrUtil;
+import cn.odboy.base.CsBaseUserTimeTb;
+import cn.odboy.framework.exception.web.BadRequestException;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
+import lombok.Data;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.sql.Types;
+import java.util.Collections;
+import java.util.List;
+import java.util.function.Consumer;
+
+/**
+ * 代码生成器入口
+ *
+ * @author odboy
+ * @date 2025-01-11
+ */
+@Data
+public class CsMpCmdGenUtil {
+ // 项目根路径。生成结果 C:\Users\Administrator\Documents\GitHub\cutejava\cutejava
+ private static final String projectRootPath = System.getProperty("user.dir") + "/";
+ /**
+ * 数据库类型 MySQL
+ */
+ private static final IDbQuery DB_QUERY = new MySqlQuery();
+ /**
+ * 类型转换
+ */
+ private static final String TYPE_TINY_INT = "tinyint";
+ private static final String TYPE_DATETIME = "datetime";
+ private static final String TYPE_DATE = "date";
+ private String databaseUrl;
+ private String databaseUsername;
+ private String databasePassword;
+ private String driverClassName;
+ private String parentPackageName = "cn.odboy";
+ private String parentModuleName;
+
+ /**
+ * 代码生成函数
+ *
+ * @param moduleName 模块名称
+ * @param tablePrefix 表前缀(可空)
+ * @param tableNames 表名称, 多个用逗号分隔
+ */
+ public void gen(String moduleName, String tablePrefix, List tableNames) {
+ this.parentModuleName = moduleName;
+ // 1.数据库配置
+ DataSourceConfig.Builder dataSourceConfigBuilder =
+ new DataSourceConfig.Builder(this.databaseUrl, this.databaseUsername, this.databasePassword).driverClassName(
+ this.driverClassName);
+ dataSourceConfigBuilder.dbQuery(DB_QUERY);
+ dataSourceConfigBuilder.keyWordsHandler(new MySqlKeyWordsHandler());
+ // 1.1.快速生成器
+ FastAutoGenerator fastAutoGenerator = FastAutoGenerator.create(dataSourceConfigBuilder);
+ // 2.全局配置
+ // 自定义类型转换
+ fastAutoGenerator.dataSourceConfig(getDataSourceConfigConsumer());
+ // 覆盖已生成文件
+ // 添加swagger注解
+ // 设置注释的作者
+ // 设置注释的日期格式
+ // 使用java8新的时间类型
+ fastAutoGenerator.globalConfig(getGlobalConfigConsumer());
+ // 3.包配置
+ // 设置父包名
+ // 设置父包模块名
+ // 设置MVC下各个模块的包名
+ // 设置XML资源文件的目录
+ fastAutoGenerator.packageConfig(getPackageConfigConsumer());
+ // 4.模板配置
+ // 使用Freemarker引擎模板, 默认的是Velocity引擎模板
+ AbstractTemplateEngine templateEngine = new FreemarkerTemplateEngine();
+ fastAutoGenerator.templateEngine(templateEngine);
+ // 5.策略配置
+ // 设置需要生成的表名
+ // 设置过滤表前缀
+ fastAutoGenerator.strategyConfig(getStrategyConfigConsumer(tableNames));
+ if (tablePrefix != null) {
+ // 表前缀, 可多个
+ fastAutoGenerator.strategyConfig(strategyConfigBuilder -> strategyConfigBuilder.addTablePrefix(tablePrefix));
+ }
+ // 5.1.Entity策略配置
+ // 生成实体时生成字段的注解, 包括@TableId注解等
+ // 数据库表和字段映射到实体的命名策略, 为下划线转驼峰
+ // 全局主键类型为None
+ // 实体名称格式化为XXXEntity
+ fastAutoGenerator.strategyConfig(getEntityConfigConsumer());
+ // 5.2.Controller策略配置
+ // 开启生成@RestController控制器
+ fastAutoGenerator.strategyConfig(strategyConfigBuilder -> strategyConfigBuilder.controllerBuilder()
+ .enableRestStyle());
+ // 如果不需要生成Controller, fastAutoGenerator.templateConfig(templateConfig -> templateConfig.controller(""))。5.3.Service策略配置:格式化service接口和实现类的文件名称, 去掉默认的ServiceName前面的I
+ fastAutoGenerator.strategyConfig(
+ strategyConfigBuilder -> strategyConfigBuilder.serviceBuilder()
+ .formatServiceFileName("%sService")
+ .formatServiceImplFileName("%sServiceImpl"));
+ // 5.4.Mapper策略配置
+ // 格式化 mapper文件名,格式化xml实现类文件名称
+ fastAutoGenerator.strategyConfig(getStrategyConfigConsumer());
+ // 6.生成代码
+ fastAutoGenerator.execute();
+ }
+
+ private static Consumer getEntityConfigConsumer() {
+ return strategyConfigBuilder -> strategyConfigBuilder.entityBuilder()
+ .enableLombok()
+ // 如果不需要生成注解, 去掉.enableTableFieldAnnotation()
+ .enableTableFieldAnnotation()
+ .enableFileOverride()
+ .naming(NamingStrategy.underline_to_camel)
+ .columnNaming(NamingStrategy.underline_to_camel)
+ .idType(IdType.AUTO);
+ }
+
+ private static Consumer getStrategyConfigConsumer(List tableNames) {
+ return strategyConfigBuilder -> strategyConfigBuilder.enableCapitalMode()
+ .enableSkipView()
+ .disableSqlFilter()
+ .addInclude(tableNames)
+ // 实体类生成策略
+ .entityBuilder()
+ .superClass(CsBaseUserTimeTb.class)
+ .addIgnoreColumns("create_time", "update_time", "create_by", "update_by")
+ // 开启生成实体时生成字段注解。
+ // 会在实体类的属性前,添加[@TableField("nickname")]
+ .enableTableFieldAnnotation()
+ .disableSerialVersionUID()
+ // 阶段2:Mapper策略配置
+ .mapperBuilder()
+ // 开启 @Mapper 注解。
+ // 会在mapper接口上添加注解[@Mapper]
+ // .enableMapperAnnotation()
+ // 启用 BaseResultMap 生成。
+ // 会在mapper.xml文件生成[通用查询映射结果]配置。
+ // .enableBaseResultMap()
+ // 启用 BaseColumnList。
+ // 会在mapper.xml文件生成[通用查询结果列 ]配置
+ // .enableBaseColumnList()
+ // 阶段4:Controller策略配置
+ .controllerBuilder()
+ // 会在控制类中加[@RestController]注解。
+ .enableRestStyle()
+ // 开启驼峰转连字符
+ .enableHyphenStyle()
+ .build();
+ }
+
+ private Consumer getPackageConfigConsumer() {
+ String mapperPath = projectRootPath + "CodeGen/resources/mapper";
+ if (StrUtil.isBlank(this.parentModuleName)) {
+ throw new BadRequestException("模块名称必填");
+ }
+ return packageConfigBuilder -> packageConfigBuilder.parent(this.parentPackageName)
+ .moduleName(this.parentModuleName)
+ .entity("dal.dataobject")
+ .mapper("dal.mysql")
+ .service("service")
+ .serviceImpl("service.impl")
+ .controller("controller")
+ .pathInfo(Collections.singletonMap(OutputFile.xml, mapperPath));
+ }
+
+ private static Consumer getGlobalConfigConsumer() {
+ String outputDir = projectRootPath + "CodeGen";
+ return globalConfigBuilder -> globalConfigBuilder.enableSwagger()
+ .outputDir(outputDir)
+ .author("codegen")
+ .commentDate("yyyy-MM-dd")
+ .dateType(DateType.TIME_PACK);
+ }
+
+ private static Consumer getStrategyConfigConsumer() {
+ return strategyConfigBuilder -> strategyConfigBuilder.mapperBuilder()
+ .mapperAnnotation(Mapper.class)
+ .formatMapperFileName("%sMapper")
+ .formatXmlFileName("%sMapper")
+ .entityBuilder()
+ .formatFileName("%sTb");
+ }
+
+ private static Consumer getDataSourceConfigConsumer() {
+ return builder -> builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
+ int typeCode = metaInfo.getJdbcType().TYPE_CODE;
+ if (typeCode == Types.SMALLINT) {
+ return DbColumnType.INTEGER;
+ }
+ if (typeCode == Types.DATE) {
+ return DbColumnType.DATE;
+ }
+ if (typeCode == Types.TIME) {
+ return DbColumnType.DATE;
+ }
+ if (typeCode == Types.TIMESTAMP) {
+ return DbColumnType.DATE;
+ }
+ return typeRegistry.getColumnType(metaInfo);
+ });
+ }
}
\ No newline at end of file
diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpQUtil.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpQUtil.java
index b88d5dfe..6bcf4bf4 100644
--- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpQUtil.java
+++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/mybatisplus/core/CsMpQUtil.java
@@ -1,221 +1,231 @@
-/*
- * Copyright 2021-2025 Odboy
- *
- * 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 cn.odboy.framework.mybatisplus.core;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.odboy.base.CsBaseUserTimeTb;
-import cn.odboy.framework.exception.BadRequestException;
-import cn.odboy.framework.mybatisplus.config.CsMpQuery;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import lombok.extern.slf4j.Slf4j;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import java.lang.reflect.Field;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 查询条件创建工具
- */
-@Slf4j
-public class CsMpQUtil {
- public static QueryWrapper build(Q query) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- if (query == null) {
- return queryWrapper;
- }
- Class> clazz = query.getClass();
- try {
- List fields = getAllFields(clazz, new ArrayList<>());
- for (Field field : fields) {
- if (!field.canAccess(query)) {
- field.setAccessible(true);
- CsMpQuery q = field.getAnnotation(CsMpQuery.class);
- if (q != null) {
- String attributeName = getAttributeName(q, field);
- Object fieldVal = field.get(query);
- if (ObjectUtil.isNull(fieldVal) || "".equals(fieldVal)) {
- continue;
- }
- if (StrUtil.isNotBlank(q.blurry())) {
- handleBlurryQuery(queryWrapper, q.blurry(), fieldVal);
- continue;
- }
- handleWrapper(q, queryWrapper, attributeName, fieldVal);
- }
- field.setAccessible(false);
- }
- }
- } catch (Exception e) {
- log.error("Failed to build query wrapper for class: {}", clazz.getName(), e);
- }
- return queryWrapper;
- }
-
- private static String getAttributeName(CsMpQuery q, Field field) {
- String attributeName = StrUtil.isBlank(q.propName()) ? field.getName() : q.propName();
- return StrUtil.toUnderlineCase(attributeName);
- }
-
- private static void handleWrapper(CsMpQuery q, QueryWrapper queryWrapper, String attributeName, Object fieldVal) {
- switch (q.type()) {
- case EQUAL:
- queryWrapper.eq(attributeName, fieldVal);
- break;
- case GREATER_THAN:
- queryWrapper.ge(attributeName, fieldVal);
- break;
- case LESS_THAN:
- queryWrapper.le(attributeName, fieldVal);
- break;
- case LESS_THAN_NQ:
- queryWrapper.lt(attributeName, fieldVal);
- break;
- case INNER_LIKE:
- queryWrapper.like(attributeName, fieldVal);
- break;
- case LEFT_LIKE:
- queryWrapper.likeLeft(attributeName, fieldVal);
- break;
- case RIGHT_LIKE:
- queryWrapper.likeRight(attributeName, fieldVal);
- break;
- case IN:
- handleInOrNotQuery(true, queryWrapper, attributeName, fieldVal);
- break;
- case NOT_IN:
- handleInOrNotQuery(false, queryWrapper, attributeName, fieldVal);
- break;
- case NOT_EQUAL:
- queryWrapper.ne(attributeName, fieldVal);
- break;
- case NOT_NULL:
- queryWrapper.isNotNull(attributeName);
- break;
- case IS_NULL:
- queryWrapper.isNull(attributeName);
- break;
- case BETWEEN:
- handleBetweenQuery(queryWrapper, fieldVal, attributeName);
- break;
- default:
- break;
- }
- }
-
- private static void handleInOrNotQuery(boolean b, QueryWrapper queryWrapper, String attributeName, Object fieldVal) {
- Collection> wrapNotInVal = (Collection>)fieldVal;
- if (CollectionUtil.isNotEmpty(wrapNotInVal)) {
- Optional> anyValOptional = wrapNotInVal.stream().findAny();
- if (anyValOptional.isPresent()) {
- Object o = anyValOptional.get();
- if (o instanceof Long) {
- if (b) {
- queryWrapper.in(attributeName, fieldVal);
- } else {
- queryWrapper.notIn(attributeName, fieldVal);
- }
- } else if (o instanceof Integer) {
- if (b) {
- queryWrapper.in(attributeName, fieldVal);
- } else {
- queryWrapper.notIn(attributeName, fieldVal);
- }
- } else {
- throw new BadRequestException("InOrNotIn查询参数类型的对象属性值必须是Long/Integer类型集合");
- }
- }
- }
- }
-
- private static void handleBetweenQuery(QueryWrapper queryWrapper, Object fieldVal, String finalAttributeName) {
- if (fieldVal instanceof List) {
- List